[llvm-commits] llvm-gcc: don't crash when emitting debug info for a field at a variable offset

Duncan Sands baldrick at free.fr
Wed Apr 11 14:22:26 PDT 2007


If a field in a record is at a variable offset from
the start of the record, then DebugInfo::getOrCreateType
crashes at this line
          MemberDesc->setOffset(int_bit_position(Member));
since the bit-offset is not an integer constant.  Fixed
by using 0 for the offset in this case - which is a cop
out, but doing anything else seems hard.  This is what
gcc does too.

Best wishes,

Duncan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: var_debug.diff
Type: text/x-diff
Size: 924 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20070411/b5d366e1/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testcase.diff
Type: text/x-diff
Size: 545 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20070411/b5d366e1/attachment-0001.diff>


More information about the llvm-commits mailing list