aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveDebugVariables.cpp
diff options
context:
space:
mode:
authorLeonard Chan <leonardchan@google.com>2020-01-30 17:09:42 -0800
committerLeonard Chan <leonardchan@google.com>2020-01-30 17:09:42 -0800
commit2d3174c4df6b5f4131346828d0a31675d80d6e2b (patch)
treeadb74a5991fd883058772f6d0b2c09d477d96c34 /llvm/lib/CodeGen/LiveDebugVariables.cpp
parent282b803b62972e22dfe43642e7d5bcd76bd102a7 (diff)
downloadllvm-2d3174c4df6b5f4131346828d0a31675d80d6e2b.zip
llvm-2d3174c4df6b5f4131346828d0a31675d80d6e2b.tar.gz
llvm-2d3174c4df6b5f4131346828d0a31675d80d6e2b.tar.bz2
[SafeStack][DebugInfo] Insert DW_OP_deref in correct location
This patch addresses the issue found in https://bugs.llvm.org/show_bug.cgi?id=44585 where a DW_OP_deref was placed at the end of a dwarf expression, resulting in corrupt symbols when debugging. This is an attempt to reland with a few fixes for buildbot since I haven't merged from master in a bit. Differential Revision: https://reviews.llvm.org/D73526
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugVariables.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveDebugVariables.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp
index 2cc547a..a133488 100644
--- a/llvm/lib/CodeGen/LiveDebugVariables.cpp
+++ b/llvm/lib/CodeGen/LiveDebugVariables.cpp
@@ -646,8 +646,8 @@ bool LDVImpl::handleDebugValue(MachineInstr &MI, SlotIndex Idx) {
}
// Get or create the UserValue for (variable,offset) here.
- assert(!MI.getOperand(1).isImm() && "DBG_VALUE with indirect flag before "
- "LiveDebugVariables");
+ assert((!MI.getOperand(1).isImm() || MI.getOperand(1).getImm() == 0) &&
+ "DBG_VALUE with nonzero offset");
const DILocalVariable *Var = MI.getDebugVariable();
const DIExpression *Expr = MI.getDebugExpression();
UserValue *UV =