[llvm] r305043 - [codeview] use 32-bit integer for RelocOffset in DebugLinesSubsection

Bob Haarman via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 8 18:18:10 PDT 2017


Author: inglorion
Date: Thu Jun  8 20:18:10 2017
New Revision: 305043

URL: http://llvm.org/viewvc/llvm-project?rev=305043&view=rev
Log:
[codeview] use 32-bit integer for RelocOffset in DebugLinesSubsection

Summary:
RelocOffset is a 32-bit value, but we previously truncated it to 16 bits.

Fixes PR33335.

Reviewers: zturner, hiraditya!

Reviewed By: zturner

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D33968

Modified:
    llvm/trunk/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h
    llvm/trunk/lib/DebugInfo/CodeView/DebugLinesSubsection.cpp
    llvm/trunk/test/DebugInfo/PDB/Inputs/debug-subsections.yaml

Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h?rev=305043&r1=305042&r2=305043&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h Thu Jun  8 20:18:10 2017
@@ -122,7 +122,7 @@ public:
   uint32_t calculateSerializedSize() const override;
   Error commit(BinaryStreamWriter &Writer) const override;
 
-  void setRelocationAddress(uint16_t Segment, uint16_t Offset);
+  void setRelocationAddress(uint16_t Segment, uint32_t Offset);
   void setCodeSize(uint32_t Size);
   void setFlags(LineFlags Flags);
 
@@ -131,7 +131,7 @@ public:
 private:
   DebugChecksumsSubsection &Checksums;
 
-  uint16_t RelocOffset = 0;
+  uint32_t RelocOffset = 0;
   uint16_t RelocSegment = 0;
   uint32_t CodeSize = 0;
   LineFlags Flags = LF_None;

Modified: llvm/trunk/lib/DebugInfo/CodeView/DebugLinesSubsection.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CodeView/DebugLinesSubsection.cpp?rev=305043&r1=305042&r2=305043&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/CodeView/DebugLinesSubsection.cpp (original)
+++ llvm/trunk/lib/DebugInfo/CodeView/DebugLinesSubsection.cpp Thu Jun  8 20:18:10 2017
@@ -145,7 +145,7 @@ uint32_t DebugLinesSubsection::calculate
 }
 
 void DebugLinesSubsection::setRelocationAddress(uint16_t Segment,
-                                                uint16_t Offset) {
+                                                uint32_t Offset) {
   RelocOffset = Offset;
   RelocSegment = Segment;
 }

Modified: llvm/trunk/test/DebugInfo/PDB/Inputs/debug-subsections.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/PDB/Inputs/debug-subsections.yaml?rev=305043&r1=305042&r2=305043&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/PDB/Inputs/debug-subsections.yaml (original)
+++ llvm/trunk/test/DebugInfo/PDB/Inputs/debug-subsections.yaml Thu Jun  8 20:18:10 2017
@@ -38,7 +38,7 @@ DbiStream:
         - !Lines
           CodeSize:        10
           Flags:           [  ]
-          RelocOffset:     16
+          RelocOffset:     100016
           RelocSegment:    1
           Blocks:
             - FileName:        'd:\src\llvm\test\debuginfo\pdb\inputs\empty.cpp'




More information about the llvm-commits mailing list