diff options
author | Adrian Prantl <aprantl@apple.com> | 2015-05-26 20:06:48 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2015-05-26 20:06:48 +0000 |
commit | 757073191a2f4beeade542fe708df2b0be89fee3 (patch) | |
tree | 015d26b60e7b212909e7a2bb31d6bf8c981ca513 /llvm/lib/CodeGen/AsmPrinter | |
parent | a235996d4c099724af795eb09f3f1fd5a75e6df7 (diff) | |
download | bcm5719-llvm-757073191a2f4beeade542fe708df2b0be89fee3.tar.gz bcm5719-llvm-757073191a2f4beeade542fe708df2b0be89fee3.zip |
Fix a use-after-free in a DEBUG output.
llvm-svn: 238242
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 4e6a031f420..c4ab3e99c89 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -857,10 +857,6 @@ DwarfDebug::buildLocationList(SmallVectorImpl<DebugLocEntry> &DebugLoc, // Attempt to coalesce the ranges of two otherwise identical // DebugLocEntries. auto CurEntry = DebugLoc.rbegin(); - auto PrevEntry = std::next(CurEntry); - if (PrevEntry != DebugLoc.rend() && PrevEntry->MergeRanges(*CurEntry)) - DebugLoc.pop_back(); - DEBUG({ dbgs() << CurEntry->getValues().size() << " Values:\n"; for (auto Value : CurEntry->getValues()) { @@ -868,6 +864,10 @@ DwarfDebug::buildLocationList(SmallVectorImpl<DebugLocEntry> &DebugLoc, } dbgs() << "-----\n"; }); + + auto PrevEntry = std::next(CurEntry); + if (PrevEntry != DebugLoc.rend() && PrevEntry->MergeRanges(*CurEntry)) + DebugLoc.pop_back(); } } |