From cb77e877f8132b885fcac8b7532c58072537b9ed Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 17 Dec 2020 10:25:11 -0800 Subject: [PATCH] [WebAssembly][lld] Don't mark a file live from an undefine symbol Live symbols should only cause the files in which they are defined to become live. For now this is only tested in emscripten: we're continuing to work on reducing the test case further for an lld-style unit test. Differential Revision: https://reviews.llvm.org/D93472 --- lld/wasm/Symbols.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lld/wasm/Symbols.cpp b/lld/wasm/Symbols.cpp index 9e41f7c..aa3b6be 100644 --- a/lld/wasm/Symbols.cpp +++ b/lld/wasm/Symbols.cpp @@ -137,7 +137,7 @@ bool Symbol::isLive() const { void Symbol::markLive() { assert(!isDiscarded()); - if (file != NULL) + if (file != NULL && isDefined()) file->markLive(); if (auto *g = dyn_cast(this)) g->global->live = true; -- 2.7.4