From: Bob Haarman Date: Fri, 9 Jun 2017 01:18:10 +0000 (+0000) Subject: [codeview] use 32-bit integer for RelocOffset in DebugLinesSubsection X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=67d04e8fdfc56a9040357672b97f1a38714aa7a8;p=llvm [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305043 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h b/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h index 1b63af59c2e..b31c9f8f0fd 100644 --- a/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h +++ b/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h @@ -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; diff --git a/lib/DebugInfo/CodeView/DebugLinesSubsection.cpp b/lib/DebugInfo/CodeView/DebugLinesSubsection.cpp index 2fce06ca2a1..33a8f78beb3 100644 --- a/lib/DebugInfo/CodeView/DebugLinesSubsection.cpp +++ b/lib/DebugInfo/CodeView/DebugLinesSubsection.cpp @@ -145,7 +145,7 @@ uint32_t DebugLinesSubsection::calculateSerializedSize() const { } void DebugLinesSubsection::setRelocationAddress(uint16_t Segment, - uint16_t Offset) { + uint32_t Offset) { RelocOffset = Offset; RelocSegment = Segment; } diff --git a/test/DebugInfo/PDB/Inputs/debug-subsections.yaml b/test/DebugInfo/PDB/Inputs/debug-subsections.yaml index efe79b976d5..ab199d2f21a 100644 --- a/test/DebugInfo/PDB/Inputs/debug-subsections.yaml +++ b/test/DebugInfo/PDB/Inputs/debug-subsections.yaml @@ -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'