Skip to content

Commit 4ac283a

Browse files
authored
fix: Fix unreachable in block statement (#2325)
1 parent 5780cd7 commit 4ac283a

File tree

5 files changed

+4149
-0
lines changed

5 files changed

+4149
-0
lines changed

src/passes/shadowstack.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,7 @@ class InstrumentReturns extends Pass {
658658
var stmts = new Array<ExpressionRef>();
659659
if (value) {
660660
let returnType = _BinaryenExpressionGetType(value);
661+
if (returnType == TypeRef.Unreachable) return;
661662
let temp = this.parentPass.getSharedTemp(this.currentFunction, returnType);
662663
// t = value
663664
stmts.push(

0 commit comments

Comments
 (0)