summaryrefslogtreecommitdiff
path: root/src/parser/contexts.h
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-02-07 17:34:47 -0800
committerGitHub <noreply@github.com>2024-02-07 17:34:47 -0800
commit0724babd6c1b7fa5891f1de2cc60228734bc4395 (patch)
tree278b08fb50e53181043b70f96f4acabd67bf71e7 /src/parser/contexts.h
parent4e0796d022fcd48c8af5a8a709577ce495bca991 (diff)
downloadbinaryen-0724babd6c1b7fa5891f1de2cc60228734bc4395.tar.gz
binaryen-0724babd6c1b7fa5891f1de2cc60228734bc4395.tar.bz2
binaryen-0724babd6c1b7fa5891f1de2cc60228734bc4395.zip
[Parser] Do not involve IRBuilder for imported functions (#6286)
We previously had a bug where we would begin and end an IRBuilder context for imported functions even though they don't have bodies. For functions that return results, ending this empty scope should have produced an error except that we had another bug where we only produced that error for multivalue functions. We did not previously have imported multivalue functions in wat-kitchen-sink.wast, so both of these bugs went undetected. Fix both bugs and update the test to include an imported multivalue function so that it would have failed without this fix.
Diffstat (limited to 'src/parser/contexts.h')
-rw-r--r--src/parser/contexts.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/parser/contexts.h b/src/parser/contexts.h
index c14a555c5..5dd48bc59 100644
--- a/src/parser/contexts.h
+++ b/src/parser/contexts.h
@@ -1324,12 +1324,15 @@ struct ParseDefsCtx : TypeParserCtx<ParseDefsCtx> {
std::optional<HeapTypeT> type,
ParamsT* params,
ResultsT* results);
+
Result<> addFunc(Name,
const std::vector<Name>&,
ImportNames*,
TypeUseT,
std::optional<LocalsT>,
- Index pos);
+ Index) {
+ return Ok{};
+ }
Result<>
addTable(Name, const std::vector<Name>&, ImportNames*, TableTypeT, Index) {