diff options
-rw-r--r-- | src/s2wasm.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/s2wasm.h b/src/s2wasm.h index cd06d5ec1..9897f7384 100644 --- a/src/s2wasm.h +++ b/src/s2wasm.h @@ -121,7 +121,7 @@ private: Name getCommaSeparated() { skipWhitespace(); std::string str; - while (*s && *s != ',') { + while (*s && *s != ',' && *s != '\n') { str += *s; s++; } @@ -421,10 +421,10 @@ private: curr->value = getInput(); } bstack.back()->list.push_back(curr); - } else if (match("func_end0:")) { - mustMatch(".size"); - mustMatch("main,"); - mustMatch("func_end0-main"); + } else if (match("func_end")) { + s = strchr(s, '\n'); + s++; + s = strchr(s, '\n'); break; // the function is done } else { abort_on("function element"); |