Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/parser/contexts.h
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,7 @@ struct ParseModuleTypesCtx : TypeParserCtx<ParseModuleTypesCtx>,
TypeUse type,
Exactness exact,
std::optional<LocalsT> locals,
std::vector<Annotation>&&,
std::vector<Annotation>&& annotations,
Index pos) {
auto& f = wasm.functions[index];
if (!type.type.isSignature()) {
Expand Down
2 changes: 1 addition & 1 deletion src/parser/lexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ struct Lexer {
const std::vector<Annotation> getAnnotations() { return annotations; }
std::vector<Annotation> takeAnnotations() { return std::move(annotations); }

void setAnnotations(std::vector<Annotation>&& annotations) {
void setAnnotations(std::vector<Annotation> annotations) {
this->annotations = std::move(annotations);
}

Expand Down
1 change: 1 addition & 0 deletions src/parser/parse-5-defs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Result<> parseDefinitions(
auto* f = decls.wasm.functions[i].get();
WithPosition with(ctx, decls.funcDefs[i].pos);
ctx.setSrcLoc(decls.funcDefs[i].annotations);
ctx.in.setAnnotations(std::move(decls.funcDefs[i].annotations));
if (!f->imported()) {
CHECK_ERR(ctx.visitFunctionStart(f));
}
Expand Down
1 change: 1 addition & 0 deletions src/parser/wat-parser-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Result<> parseDefs(Ctx& ctx,
for (auto& def : defs) {
ctx.index = def.index;
WithPosition with(ctx, def.pos);
ctx.in.setAnnotations(def.annotations);
if (auto parsed = parser(ctx)) {
CHECK_ERR(parsed);
} else {
Expand Down
Loading