[PATCH] D114195: [lld/mac] Crash even less on undefined symbols with --icf=all

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 19 06:23:34 PST 2021


thakis added inline comments.


================
Comment at: lld/MachO/ICF.cpp:117
       if (!isa<Defined>(sa)) {
-        assert(isa<DylibSymbol>(sa));
+        assert(isa<DylibSymbol>(sa) || isa<Undefined>(sa));
         return sa == sb;
----------------
int3 wrote:
> hmm having an Undefined here basically means that the link will error out, right? maybe add a comment to that effect
> 
> (tbh I'm not sure the assert is worth much any more, basically the only thing we are still excluding is LazySymbols...)
Correct, it'll error out later. Added a comment here and in the other place.

Thanks!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114195/new/

https://reviews.llvm.org/D114195



More information about the llvm-commits mailing list