summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/wasm-interpreter.h6
-rw-r--r--src/wasm-s-parser.h8
2 files changed, 5 insertions, 9 deletions
diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h
index d231aee42..5dbd09ef1 100644
--- a/src/wasm-interpreter.h
+++ b/src/wasm-interpreter.h
@@ -252,8 +252,10 @@ private:
}
auto iter = caseMap.find(target);
if (iter == caseMap.end()) {
- // not in the cases, so this is a break outside
- return Flow(target);
+ // not in the cases, so this is a break
+ Flow flow(target);
+ flow.clearIf(curr->name);
+ return flow;
}
size_t caseIndex = iter->second;
assert(caseIndex < curr->cases.size());
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h
index dfef00d9b..afcc8e2ec 100644
--- a/src/wasm-s-parser.h
+++ b/src/wasm-s-parser.h
@@ -920,13 +920,7 @@ private:
i++;
for (size_t j = 1; j < table.size(); j++) {
Element& curr = *table[j];
- if (curr[0]->str() == CASE) {
- ret->targets.push_back(curr[1]->str());
- } else {
- assert(curr[0]->str() == BR);
- assert(curr[1]->str() == ret->name);
- ret->targets.push_back(Name());
- }
+ ret->targets.push_back(curr[1]->str());
}
Element& curr = *s[i];
if (curr[0]->str() == CASE) {