summaryrefslogtreecommitdiff
path: root/src/parser/wat-parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser/wat-parser.cpp')
-rw-r--r--src/parser/wat-parser.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/parser/wat-parser.cpp b/src/parser/wat-parser.cpp
index 2bc222d6b..85ef1e80f 100644
--- a/src/parser/wat-parser.cpp
+++ b/src/parser/wat-parser.cpp
@@ -202,7 +202,10 @@ Result<> doParseModule(Module& wasm, Lexer& input, bool allowExtra) {
CHECK_ERR(im);
}
if (!f->imported()) {
- CHECK_ERR(ctx.irBuilder.visitEnd());
+ auto end = ctx.irBuilder.visitEnd();
+ if (auto* err = end.getErr()) {
+ return ctx.in.err(decls.funcDefs[i].pos, err->msg);
+ }
}
}