[PATCH] D46391: [DebugInfo] Correction for an assert in DIExpression::createFragmentExpression
Bjorn Pettersson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 3 07:29:07 PDT 2018
bjope created this revision.
bjope added reviewers: aprantl, vsk.
Herald added a subscriber: JDevlieghere.
When we create a fragment expression, and there already is an
old fragment expression, we assert that the new fragment is
within the range for the old fragment.
If for example the old fragment expression says that we
describe bit 10-16 of a variable (Offset=10, Size=6),
and we now want to create a new fragment expression only
describing bit 3-6 of the original value, then the resulting
fragment expression should have Offset=13, Size=3.
The assert is supposed to catch if the resulting fragment
expression is outside the range for the old fragment. However,
it used to verify that the Offset+Size of the new fragment was
smaller or equal than Offset+Size for the old fragment. What
we really want to check is that Offset+Size of the new fragment
is smaller than the Size of the old fragment.
Repository:
rL LLVM
https://reviews.llvm.org/D46391
Files:
lib/IR/DebugInfoMetadata.cpp
Index: lib/IR/DebugInfoMetadata.cpp
===================================================================
--- lib/IR/DebugInfoMetadata.cpp
+++ lib/IR/DebugInfoMetadata.cpp
@@ -832,7 +832,7 @@
uint64_t FragmentOffsetInBits = Op.getArg(0);
// Op.getArg(0) is FragmentOffsetInBits.
// Op.getArg(1) is FragmentSizeInBits.
- assert((OffsetInBits + SizeInBits <= Op.getArg(0) + Op.getArg(1)) &&
+ assert((OffsetInBits + SizeInBits <= Op.getArg(1)) &&
"new fragment outside of original fragment");
OffsetInBits += FragmentOffsetInBits;
continue;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46391.145018.patch
Type: text/x-patch
Size: 612 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180503/7ad7494d/attachment.bin>
More information about the llvm-commits
mailing list