From 0724babd6c1b7fa5891f1de2cc60228734bc4395 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Wed, 7 Feb 2024 17:34:47 -0800 Subject: [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. --- src/parser/contexts.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/parser/contexts.h') 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 { std::optional type, ParamsT* params, ResultsT* results); + Result<> addFunc(Name, const std::vector&, ImportNames*, TypeUseT, std::optional, - Index pos); + Index) { + return Ok{}; + } Result<> addTable(Name, const std::vector&, ImportNames*, TableTypeT, Index) { -- cgit v1.2.3