From db7285b8f8e1a536fdfee60103bafc4ecfe3ed1f Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 14 Jan 2016 11:45:13 -0800 Subject: break assert --- src/wasm-binary.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/wasm-binary.h') diff --git a/src/wasm-binary.h b/src/wasm-binary.h index 9890453a6..16b9419e5 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -593,12 +593,15 @@ public: void visitBreak(Break *curr) { if (debug) std::cerr << "zz node: Break" << std::endl; o << int8_t(curr->condition ? BinaryConsts::BrIf : BinaryConsts::Br); + bool found = false; for (int i = breakStack.size() - 1; i >= 0; i--) { if (breakStack[i] == curr->name) { o << int8_t(breakStack.size() - 1 - i); + found = true; break; } } + assert(found); if (curr->condition) recurse(curr->condition); } void visitSwitch(Switch *curr) { -- cgit v1.2.3