diff options
-rw-r--r-- | src/wasm-s-parser.h | 5 | ||||
-rw-r--r-- | src/wasm.cpp | 1 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index bb6fe3fd4..e6262c645 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -1107,10 +1107,9 @@ private: if (s.dollared()) { return s.str(); } else { - size_t offset = atol(s.c_str()); - if (offset >= labelStack.size()) - return getPrefixedName("invalid"); // offset, break to nth outside label + uint64_t offset = std::stoll(s.c_str(), nullptr, 0); + if (offset >= labelStack.size()) throw ParseException("total memory must be <= 4GB", s.line, s.col); return labelStack[labelStack.size() - 1 - offset]; } } diff --git a/src/wasm.cpp b/src/wasm.cpp index d00ddd42f..48a0f276a 100644 --- a/src/wasm.cpp +++ b/src/wasm.cpp @@ -40,6 +40,7 @@ struct TypeSeeker : public PostWalker<TypeSeeker, Visitor<TypeSeeker>> { for (auto name : curr->targets) { if (name == targetName) types.push_back(curr->value ? curr->value->type : none); } + if (curr->default_ == targetName) types.push_back(curr->value ? curr->value->type : none); } void visitBlock(Block* curr) { |