From 9c374b6a2368ef5cb0c102e3e2f164410289f454 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 16 Mar 2016 16:52:20 -0700 Subject: use leb128 in breaks --- src/wasm-binary.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/wasm-binary.h b/src/wasm-binary.h index 7a801920e..5dd363b9d 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -781,7 +781,7 @@ public: } if (curr->condition) recurse(curr->condition); o << int8_t(curr->condition ? BinaryConsts::BrIf : BinaryConsts::Br) - << int32_t(getBreakIndex(curr->name)); + << LEB128(getBreakIndex(curr->name)); } void visitSwitch(Switch *curr) { if (debug) std::cerr << "zz node: Switch" << std::endl; @@ -1599,7 +1599,7 @@ public: void visitBreak(Break *curr, uint8_t code) { if (debug) std::cerr << "zz node: Break" << std::endl; - curr->name = getBreakName(getInt32()); + curr->name = getBreakName(getLEB128()); if (code == BinaryConsts::BrIf) curr->condition = popExpression(); curr->value = popExpression(); } -- cgit v1.2.3