Lgtm<br><div class="gmail_quote"><div dir="ltr">On Tue, Jun 6, 2017 at 5:13 PM Bob Haarman via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">inglorion created this revision.<br>
Herald added a reviewer: hiraditya.<br>
<br>
RelocOffset is a 32-bit value, but we previously truncated it to 16 bits.<br>
<br>
Fixes PR33335.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D33968" rel="noreferrer" target="_blank">https://reviews.llvm.org/D33968</a><br>
<br>
Files:<br>
  llvm/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h<br>
  llvm/lib/DebugInfo/CodeView/DebugLinesSubsection.cpp<br>
  llvm/test/DebugInfo/PDB/Inputs/simple-line-info.yaml<br>
  llvm/test/DebugInfo/PDB/pdbdump-yaml-lineinfo-write.test<br>
<br>
<br>
Index: llvm/test/DebugInfo/PDB/pdbdump-yaml-lineinfo-write.test<br>
===================================================================<br>
--- llvm/test/DebugInfo/PDB/pdbdump-yaml-lineinfo-write.test<br>
+++ llvm/test/DebugInfo/PDB/pdbdump-yaml-lineinfo-write.test<br>
@@ -29,7 +29,7 @@<br>
 LINES-NEXT:        Lines {<br>
 LINES-NEXT:          Block {<br>
 LINES-NEXT:            RelocSegment: 1<br>
-LINES-NEXT:            RelocOffset: 16<br>
+LINES-NEXT:            RelocOffset: 100016<br>
 LINES-NEXT:            CodeSize: 10<br>
 LINES-NEXT:            HasColumns: No<br>
 LINES-NEXT:            Lines {<br>
Index: llvm/test/DebugInfo/PDB/Inputs/simple-line-info.yaml<br>
===================================================================<br>
--- llvm/test/DebugInfo/PDB/Inputs/simple-line-info.yaml<br>
+++ llvm/test/DebugInfo/PDB/Inputs/simple-line-info.yaml<br>
@@ -17,7 +17,7 @@<br>
         - !Lines<br>
           CodeSize:        10<br>
           Flags:           [  ]<br>
-          RelocOffset:     16<br>
+          RelocOffset:     100016<br>
           RelocSegment:    1<br>
           Blocks:<br>
             - FileName:        'd:\src\llvm\test\debuginfo\pdb\inputs\empty.cpp'<br>
Index: llvm/lib/DebugInfo/CodeView/DebugLinesSubsection.cpp<br>
===================================================================<br>
--- llvm/lib/DebugInfo/CodeView/DebugLinesSubsection.cpp<br>
+++ llvm/lib/DebugInfo/CodeView/DebugLinesSubsection.cpp<br>
@@ -145,7 +145,7 @@<br>
 }<br>
<br>
 void DebugLinesSubsection::setRelocationAddress(uint16_t Segment,<br>
-                                                uint16_t Offset) {<br>
+                                                uint32_t Offset) {<br>
   RelocOffset = Offset;<br>
   RelocSegment = Segment;<br>
 }<br>
Index: llvm/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h<br>
===================================================================<br>
--- llvm/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h<br>
+++ llvm/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h<br>
@@ -122,16 +122,16 @@<br>
   uint32_t calculateSerializedSize() const override;<br>
   Error commit(BinaryStreamWriter &Writer) const override;<br>
<br>
-  void setRelocationAddress(uint16_t Segment, uint16_t Offset);<br>
+  void setRelocationAddress(uint16_t Segment, uint32_t Offset);<br>
   void setCodeSize(uint32_t Size);<br>
   void setFlags(LineFlags Flags);<br>
<br>
   bool hasColumnInfo() const;<br>
<br>
 private:<br>
   DebugChecksumsSubsection &Checksums;<br>
<br>
-  uint16_t RelocOffset = 0;<br>
+  uint32_t RelocOffset = 0;<br>
   uint16_t RelocSegment = 0;<br>
   uint32_t CodeSize = 0;<br>
   LineFlags Flags = LF_None;<br>
<br>
<br>
</blockquote></div>