summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-12-14 10:11:55 -0800
committerGitHub <noreply@github.com>2021-12-14 10:11:55 -0800
commitb1f6298ed8756bdc3336429c04b92ba58d000b49 (patch)
treeaa6bac5c63bce0106c6a5881e13aa324c247d492 /src
parent0797d8383e6250ffff48cd98afd9a45b70ab2771 (diff)
downloadbinaryen-b1f6298ed8756bdc3336429c04b92ba58d000b49.tar.gz
binaryen-b1f6298ed8756bdc3336429c04b92ba58d000b49.tar.bz2
binaryen-b1f6298ed8756bdc3336429c04b92ba58d000b49.zip
Add requireFunctionContext in necessary places (#4388)
Fixes #4384
Diffstat (limited to 'src')
-rw-r--r--src/wasm/wasm-binary.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp
index 1b82f5760..bf29f948b 100644
--- a/src/wasm/wasm-binary.cpp
+++ b/src/wasm/wasm-binary.cpp
@@ -2611,6 +2611,7 @@ void WasmBinaryBuilder::pushExpression(Expression* curr) {
}
}
auto nullableType = Type(Tuple(finalTypes));
+ requireFunctionContext("pushExpression-tuple");
Index tuple = builder.addVar(currFunction, nullableType);
expressionStack.push_back(builder.makeLocalSet(tuple, curr));
for (Index i = 0; i < nullableType.size(); ++i) {
@@ -3740,6 +3741,7 @@ BinaryConsts::ASTNodes WasmBinaryBuilder::readExpression(Expression*& curr) {
}
if (curr) {
if (currDebugLocation.size()) {
+ requireFunctionContext("debugLocation");
currFunction->debugLocations[curr] = *currDebugLocation.begin();
}
if (DWARF && currFunction) {
@@ -3846,6 +3848,7 @@ void WasmBinaryBuilder::visitBlock(Block* curr) {
startControlFlow(curr);
pos++;
if (debugLocation.size()) {
+ requireFunctionContext("block-debugLocation");
currFunction->debugLocations[curr] = *debugLocation.begin();
}
continue;
@@ -6533,6 +6536,7 @@ void WasmBinaryBuilder::visitLet(Block* curr) {
curr->type = getType();
// Get the new local types. First, get the absolute index from which we will
// start to allocate them.
+ requireFunctionContext("let");
Index absoluteStart = currFunction->vars.size();
readVars();
Index numNewVars = currFunction->vars.size() - absoluteStart;