From 192b59a8bc8e5376ca120dc592d5abad7c654230 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 6 Sep 2017 10:00:57 -0700 Subject: clean up untaken => unreachable, as well as unnecessary named stuff in validation that was from when we differentiated reachable from unreachable breaks (#1166) --- src/wasm/wasm-validator.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/wasm/wasm-validator.cpp') diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index 877232521..8e93b1c38 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -58,7 +58,6 @@ void WasmValidator::visitBlock(Block *curr) { } } breakTargets.erase(curr->name); - namedBreakTargets.erase(curr->name); } if (curr->list.size() > 1) { for (Index i = 0; i < curr->list.size() - 1; i++) { @@ -88,7 +87,6 @@ void WasmValidator::visitLoop(Loop *curr) { if (curr->name.is()) { noteLabelName(curr->name); breakTargets.erase(curr->name); - namedBreakTargets.erase(curr->name); if (breakInfos.count(curr) > 0) { auto& info = breakInfos[curr]; shouldBeEqual(info.arity, Index(0), curr, "breaks to a loop cannot pass a value"); @@ -128,7 +126,6 @@ void WasmValidator::visitIf(If *curr) { } void WasmValidator::noteBreak(Name name, Expression* value, Expression* curr) { - namedBreakTargets.insert(name); WasmType valueType = none; Index arity = 0; if (value) { @@ -550,9 +547,7 @@ void WasmValidator::visitFunction(Function *curr) { if (returnType != unreachable) { shouldBeEqual(curr->result, returnType, curr->body, "function result must match, if function has returns"); } - if (!shouldBeTrue(namedBreakTargets.empty(), curr->body, "all named break targets must exist") && !quiet) { - std::cerr << "(on label " << *namedBreakTargets.begin() << ")\n"; - } + shouldBeTrue(breakTargets.empty(), curr->body, "all named break targets must exist"); returnType = unreachable; labelNames.clear(); } -- cgit v1.2.3