From 557983e5020d0a28dba1f63ee9e515c6b779bfd4 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 26 Feb 2019 19:42:39 -0500 Subject: fix handling when there are multiple externs and an export in the same object closes #529 --- src/analyze.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/analyze.cpp') diff --git a/src/analyze.cpp b/src/analyze.cpp index a6c158a780..3ceda41934 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -3439,9 +3439,9 @@ static void add_top_level_decl(CodeGen *g, ScopeDecls *decls_scope, Tld *tld) { if (is_export) { g->resolve_queue.append(tld); - auto entry = g->exported_symbol_names.put_unique(tld->name, tld->source_node); + auto entry = g->exported_symbol_names.put_unique(tld->name, tld); if (entry) { - AstNode *other_source_node = entry->value; + AstNode *other_source_node = entry->value->source_node; ErrorMsg *msg = add_node_error(g, tld->source_node, buf_sprintf("exported symbol collision: '%s'", buf_ptr(tld->name))); add_error_note(g, msg, other_source_node, buf_sprintf("other symbol here")); -- cgit v1.2.3