[PATCH] D47238: [WebAssembly] Fix crash when relocation synbol is not live

Yury Delendik via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 22 18:03:33 PDT 2018


yurydelendik accepted this revision.
yurydelendik added a comment.
This revision is now accepted and ready to land.

Looks good. Thank you.



================
Comment at: wasm/InputFiles.cpp:129
     if (auto *Sym = dyn_cast<DefinedData>(getDataSymbol(Reloc.Index)))
-      return Sym->getVirtualAddress() + Reloc.Addend;
+      if (Sym->isLive())
+        return Sym->getVirtualAddress() + Reloc.Addend;
----------------
I'm not sure about code formatting here: do we need braces for outer if since it has a two line body now?


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D47238





More information about the llvm-commits mailing list