summaryrefslogtreecommitdiff
path: root/src/s2wasm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/s2wasm.h')
-rw-r--r--src/s2wasm.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/s2wasm.h b/src/s2wasm.h
index 31b28f1e2..649b32196 100644
--- a/src/s2wasm.h
+++ b/src/s2wasm.h
@@ -952,12 +952,16 @@ class S2WasmBuilder {
bstack.pop_back();
} else if (match("br")) {
auto curr = allocator.alloc<Break>();
+ bool hasCondition = false;
if (*s == '_') {
mustMatch("_if");
- curr->condition = getInput();
- skipComma();
+ hasCondition = true;
}
curr->name = getBranchLabel(getInt());
+ if (hasCondition) {
+ skipComma();
+ curr->condition = getInput();
+ }
addToBlock(curr);
} else if (match("call")) {
makeCall(none);