diff options
Diffstat (limited to 'src/ir/effects.h')
-rw-r--r-- | src/ir/effects.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ir/effects.h b/src/ir/effects.h index c0210c221..80aa74cb6 100644 --- a/src/ir/effects.h +++ b/src/ir/effects.h @@ -515,12 +515,12 @@ private: if (parent.tryDepth == 0) { parent.throws = true; } - // rethrow traps when the arg is null + // traps when the arg is null parent.implicitTrap = true; } void visitBrOnExn(BrOnExn* curr) { parent.breakTargets.insert(curr->name); - // br_on_exn traps when the arg is null + // traps when the arg is null parent.implicitTrap = true; } void visitNop(Nop* curr) {} @@ -562,7 +562,10 @@ private: WASM_UNREACHABLE("TODO (gc): struct.new"); } void visitStructGet(StructGet* curr) { - WASM_UNREACHABLE("TODO (gc): struct.get"); + // traps when the arg is null + if (curr->value->type.isNullable()) { + parent.implicitTrap = true; + } } void visitStructSet(StructSet* curr) { WASM_UNREACHABLE("TODO (gc): struct.set"); |