From: Nemanja Ivanovic Date: Wed, 15 Apr 2020 20:40:51 +0000 (-0500) Subject: [PowerPC] Clear the set of symbols that need to be updated in MCTargetStreamer X-Git-Tag: llvmorg-12-init~8912 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c196e2ca48b739cae7d83e1ee0136f426f60aa53;p=platform%2Fupstream%2Fllvm.git [PowerPC] Clear the set of symbols that need to be updated in MCTargetStreamer We have added code to correct the .localentry values on assignments. However, we never clear the set so presumably it will still contain the (now dangling) MCSymbol pointers across a call to finish() and reset() in the streamer. This is based on my speculation that it is the reason we are getting segmentation faults mentioned in https://bugs.llvm.org/show_bug.cgi?id=45366 Fixes: https://bugs.llvm.org/show_bug.cgi?id=45366 Differential revision: https://reviews.llvm.org/D78196 --- diff --git a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp index c85b08a..d8e1dd3 100644 --- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp +++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp @@ -210,6 +210,10 @@ public: for (auto *Sym : UpdateOther) if (Sym->isVariable()) copyLocalEntry(Sym, Sym->getVariableValue()); + + // Clear the set of symbols that needs to be updated so the streamer can + // be reused without issues. + UpdateOther.clear(); } private: