diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-02-26 19:42:39 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-02-26 19:43:12 -0500 |
| commit | 557983e5020d0a28dba1f63ee9e515c6b779bfd4 (patch) | |
| tree | 2fd2b3b2715d99eba024e0c6d27fe5cf29c9be38 /src/analyze.cpp | |
| parent | 763357c9c3e8feba34a932c60b55f2224989f2d4 (diff) | |
| download | zig-557983e5020d0a28dba1f63ee9e515c6b779bfd4.tar.gz zig-557983e5020d0a28dba1f63ee9e515c6b779bfd4.zip | |
fix handling when there are multiple externs and
an export in the same object
closes #529
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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")); |
