Skip to content

Commit 424ecf0

Browse files
surmaMaxGraey
andauthored
Update src/compiler.ts
Co-authored-by: Max Graey <[email protected]>
1 parent 8ec6c96 commit 424ecf0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9944,8 +9944,8 @@ export class Compiler extends DiagnosticEmitter {
99449944
// Needs to be true when the ref is _not_ null.
99459945
// Therefore: 1 - <ref.is_null>
99469946
return type.size == 64
9947-
? module.binary(BinaryOp.SubI64, module.i64(1), module.ref_is(RefIsOp.RefIsNull, expr))
9948-
: module.binary(BinaryOp.SubI32, module.i32(1), module.ref_is(RefIsOp.RefIsNull, expr));
9947+
? module.unary(BinaryOp.EqzI64, module.ref_is(RefIsOp.RefIsNull, expr))
9948+
: module.unary(BinaryOp.EqzI32, module.ref_is(RefIsOp.RefIsNull, expr));
99499949

99509950
}
99519951
default: {

0 commit comments

Comments
 (0)