summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-13 00:06:28 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-13 00:06:28 +0000
commit5cd454161c9e8e4f63c2c82529929450a5b3faf7 (patch)
tree60f6042ce3f9af15011188b55c97349ed7712a44 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parent452b036697670214e795d8ce02cd0e32cf5474d3 (diff)
downloadbcm5719-llvm-5cd454161c9e8e4f63c2c82529929450a5b3faf7.tar.gz
bcm5719-llvm-5cd454161c9e8e4f63c2c82529929450a5b3faf7.zip
Revert "Verifier: Check for incompatible bit piece expressions"
This reverts commit r234698. This caused a use-after-free: `QueuedBitPieceExpressions` holds onto references to `DbgInfoIntrinsic`s and references them past where they're deleted (this is because the verifier is run as a function pass, and then `verifyTypeRefs()` is called during `doFinalization()`). I'll include a reduced crasher for `llc` when I recommit the check. llvm-svn: 234717
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 2998d1fbf30..76e019bf8e9 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1535,7 +1535,15 @@ void DebugLocEntry::finalize(const AsmPrinter &AP,
Offset += PieceOffset-Offset;
}
Offset += PieceSize;
-
+
+#ifndef NDEBUG
+ DIVariable Var = Piece.getVariable();
+ unsigned VarSize = Var.getSizeInBits(TypeIdentifierMap);
+ assert(PieceSize+PieceOffset <= VarSize
+ && "piece is larger than or outside of variable");
+ assert(PieceSize != VarSize
+ && "piece covers entire variable");
+#endif
emitDebugLocValue(AP, TypeIdentifierMap, Streamer, Piece, PieceOffset);
}
} else {
OpenPOWER on IntegriCloud