summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wasm-s-parser.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h
index 3b6b07fb0..73421e773 100644
--- a/src/wasm-s-parser.h
+++ b/src/wasm-s-parser.h
@@ -251,15 +251,16 @@ public:
assert(module[0]->str() == MODULE);
if (module.size() > 1 && module[1]->isStr()) {
// these s-expressions contain a binary module, actually
- auto str = module[1]->c_str();
- if (auto size = strlen(str)) {
- std::vector<char> data;
- stringToBinary(str, size, data);
- WasmBinaryBuilder binaryBuilder(wasm, data, false);
- binaryBuilder.read();
- } else {
- onError();
+ std::vector<char> data;
+ size_t i = 1;
+ while (i < module.size()) {
+ auto str = module[i++]->c_str();
+ if (auto size = strlen(str)) {
+ stringToBinary(str, size, data);
+ }
}
+ WasmBinaryBuilder binaryBuilder(wasm, data, false);
+ binaryBuilder.read();
return;
}
functionCounter = 0;