summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2017-03-23 20:23:42 +0000
committerAdrian Prantl <aprantl@apple.com>2017-03-23 20:23:42 +0000
commit8f3337950e88ae7934ffda13f15f1b9dc7e6a9a5 (patch)
treee5274133709a2fb2a71c2e3f14742e60e704c0a0 /llvm/lib/CodeGen
parent638d4538cdb0f9158aa3819c87106538977c3733 (diff)
downloadbcm5719-llvm-8f3337950e88ae7934ffda13f15f1b9dc7e6a9a5.tar.gz
bcm5719-llvm-8f3337950e88ae7934ffda13f15f1b9dc7e6a9a5.zip
Zero-Initialize PrevInstBB when entering a new MachineFunction.
It is not guaranteed that the memory used for MachineBasicBlocks in the previous MachineFunction hasn't been freed, so holding on to a pointer to the last function's isn't correct. Particularly I have observed the sret.ll testcase failing because the first BasicBlock in the new function happened to be allocated to the exact same memory as the previously saved and (deleted) PrevInstBB. llvm-svn: 298642
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
index aa8b8fbb869..1d63e33a4d3 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
@@ -130,6 +130,7 @@ bool hasDebugInfo(const MachineModuleInfo *MMI, const MachineFunction *MF) {
void DebugHandlerBase::beginFunction(const MachineFunction *MF) {
assert(Asm);
+ PrevInstBB = nullptr;
if (!hasDebugInfo(MMI, MF)) {
skippedNonDebugFunction();
OpenPOWER on IntegriCloud