summaryrefslogtreecommitdiff
path: root/src/parser/contexts.h
diff options
context:
space:
mode:
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 5ad0c16de..bce051a93 100644
--- a/src/parser/contexts.h
+++ b/src/parser/contexts.h
@@ -1665,7 +1665,10 @@ struct ParseDefsCtx : TypeParserCtx<ParseDefsCtx> {
return Ok{};
}
- Result<> addExport(Index, Name value, Name name, ExternalKind kind) {
+ Result<> addExport(Index pos, Name value, Name name, ExternalKind kind) {
+ if (wasm.getExportOrNull(name)) {
+ return in.err(pos, "duplicate export");
+ }
wasm.addExport(builder.makeExport(name, value, kind));
return Ok{};
}