Skip to content

Commit fee7795

Browse files
committed
fix it in caller side
1 parent 0894370 commit fee7795

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
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
}

src/module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3019,7 +3019,6 @@ export function isNullableType(type: TypeRef): bool {
30193019
// expressions
30203020

30213021
export function getExpressionId(expr: ExpressionRef): ExpressionId {
3022-
if (expr == 0) return ExpressionId.Invalid;
30233022
return binaryen._BinaryenExpressionGetId(expr);
30243023
}
30253024

0 commit comments

Comments
 (0)