summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorYichao Yu <yyc1992@gmail.com>2017-10-17 11:44:34 +0000
committerYichao Yu <yyc1992@gmail.com>2017-10-17 11:44:34 +0000
commita46eb8e6490f72dd3510a93ece78d0919e19702c (patch)
tree2a115427a51ffa0b2f801f177249c3e70aa0f8b0 /llvm/lib/Target
parent17db3a10f5c51bf6464b69b118786d6d49dcbf0f (diff)
downloadbcm5719-llvm-a46eb8e6490f72dd3510a93ece78d0919e19702c.tar.gz
bcm5719-llvm-a46eb8e6490f72dd3510a93ece78d0919e19702c.zip
Fix `FaultMaps` crash when the out streamer is reused
Summary: Make sure the map is cleared before processing a new module. Similar to what is done on `StackMaps`. This issue is similar to D38588, though this time for FaultMaps (on x86) rather than ARM/AArch64. Other than possible mixing of information between modules, the crash is caused by the pointers values in the map that was allocated by the bump pointer allocator that is unwinded when emitting the next file. This issue has been around since 3.8. This issue is likely much harder to write a test for since AFAICT it requires emitting something much more compilcated (and possibly real code) instead of just some random bytes. Reviewers: skatkov, sanjoy Reviewed By: skatkov, sanjoy Subscribers: sanjoy, aemerson, llvm-commits, kristof.beyls Differential Revision: https://reviews.llvm.org/D38924 llvm-svn: 315990
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/X86/X86AsmPrinter.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86AsmPrinter.h b/llvm/lib/Target/X86/X86AsmPrinter.h
index 7a40552ee38..c5c29b611cc 100644
--- a/llvm/lib/Target/X86/X86AsmPrinter.h
+++ b/llvm/lib/Target/X86/X86AsmPrinter.h
@@ -135,6 +135,7 @@ public:
bool doInitialization(Module &M) override {
SMShadowTracker.reset(0);
SM.reset();
+ FM.reset();
return AsmPrinter::doInitialization(M);
}
OpenPOWER on IntegriCloud