We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 34f8d2f commit 4f52bffCopy full SHA for 4f52bff
src/wasm/wasm-binary.cpp
@@ -4763,12 +4763,15 @@ void WasmBinaryReader::readExports() {
4763
4764
Expression* WasmBinaryReader::readExpression() {
4765
assert(builder.empty());
4766
- while (input[pos] != BinaryConsts::End) {
+ while (more() && input[pos] != BinaryConsts::End) {
4767
auto inst = readInst();
4768
if (auto* err = inst.getErr()) {
4769
throwError(err->msg);
4770
}
4771
4772
+ if (!more()) {
4773
+ throwError("unexpected end of input");
4774
+ }
4775
++pos;
4776
auto expr = builder.build();
4777
if (auto* err = expr.getErr()) {
0 commit comments