summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/s2wasm.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/s2wasm.h b/src/s2wasm.h
index ed8d3e0e3..b0fe7c431 100644
--- a/src/s2wasm.h
+++ b/src/s2wasm.h
@@ -246,11 +246,14 @@ private:
} else if (match(".result")) {
func->result = getType();
} else if (match(".local")) {
- Name name = getNextId();
- WasmType type = getType();
- func->locals.emplace_back(name, type);
- localTypes[name] = type;
- skipWhitespace();
+ while (1) {
+ Name name = getNextId();
+ WasmType type = getType();
+ func->locals.emplace_back(name, type);
+ localTypes[name] = type;
+ skipWhitespace();
+ if (!match(",")) break;
+ }
} else break;
}
// parse body