summaryrefslogtreecommitdiff
path: root/src/wasm-interpreter.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-interpreter.h')
-rw-r--r--src/wasm-interpreter.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h
index 26c86efe6..ac64a30c0 100644
--- a/src/wasm-interpreter.h
+++ b/src/wasm-interpreter.h
@@ -1490,6 +1490,15 @@ public:
}
const auto& value = flow.getSingleValue();
NOTE_EVAL1(value);
+ if (curr->op == BrOnNull) {
+ // Unlike the others, BrOnNull does not propagate the value if it takes
+ // the branch.
+ if (value.isNull()) {
+ return Flow(curr->name);
+ }
+ // If the branch is not taken, we return the non-null value.
+ return {value};
+ }
if (value.isNull()) {
return {value};
}