[PATCH] D16509: [DebugInfo] Fix DWARFDebugFrame instruction operand ordering

Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 26 05:35:22 PST 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL258806: [DebugInfo] Fix DWARFDebugFrame instruction operand ordering (authored by igor.laevsky).

Changed prior to commit:
  http://reviews.llvm.org/D16509?vs=45794&id=45979#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D16509

Files:
  llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp

Index: llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
===================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
@@ -160,18 +160,26 @@
         case DW_CFA_offset_extended:
         case DW_CFA_register:
         case DW_CFA_def_cfa:
-        case DW_CFA_val_offset:
+        case DW_CFA_val_offset: {
           // Operands: ULEB128, ULEB128
-          addInstruction(Opcode, Data.getULEB128(Offset),
-                                 Data.getULEB128(Offset));
+          // Note: We can not embed getULEB128 directly into function
+          // argument list. getULEB128 changes Offset and order of evaluation
+          // for arguments is unspecified.
+          auto op1 = Data.getULEB128(Offset);
+          auto op2 = Data.getULEB128(Offset);
+          addInstruction(Opcode, op1, op2);
           break;
+        }
         case DW_CFA_offset_extended_sf:
         case DW_CFA_def_cfa_sf:
-        case DW_CFA_val_offset_sf:
+        case DW_CFA_val_offset_sf: {
           // Operands: ULEB128, SLEB128
-          addInstruction(Opcode, Data.getULEB128(Offset),
-                                 Data.getSLEB128(Offset));
+          // Note: see comment for the previous case
+          auto op1 = Data.getULEB128(Offset);
+          auto op2 = (uint64_t)Data.getSLEB128(Offset);
+          addInstruction(Opcode, op1, op2);
           break;
+        }
         case DW_CFA_def_cfa_expression:
         case DW_CFA_expression:
         case DW_CFA_val_expression:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16509.45979.patch
Type: text/x-patch
Size: 1598 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160126/dd26efce/attachment.bin>


More information about the llvm-commits mailing list