Skip to content

Commit 7e2a62d

Browse files
authored
fix: avoid to visit nullptr in binaryen (#2943)
1 parent 6cd638e commit 7e2a62d

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
@@ -6764,7 +6764,7 @@ export class Compiler extends DiagnosticEmitter {
67646764
if (thisType.isManaged) {
67656765
let operand = operands[0];
67666766
let precomp = module.runExpression(operand, ExpressionRunnerFlags.Default);
6767-
if (!isConstZero(precomp)) { // otherwise unnecessary
6767+
if (!precomp || !isConstZero(precomp)) { // otherwise unnecessary
67686768
operands[operandIndex] = module.tostack(operand);
67696769
}
67706770
}
@@ -6778,7 +6778,7 @@ export class Compiler extends DiagnosticEmitter {
67786778
if (paramType.isManaged) {
67796779
let operand = operands[operandIndex];
67806780
let precomp = module.runExpression(operand, ExpressionRunnerFlags.Default);
6781-
if (!isConstZero(precomp)) { // otherwise unnecessary
6781+
if (!precomp || !isConstZero(precomp)) { // otherwise unnecessary
67826782
operands[operandIndex] = module.tostack(operand);
67836783
}
67846784
}

0 commit comments

Comments
 (0)