Skip to content

Conversation

@alx32
Copy link
Contributor

@alx32 alx32 commented Mar 13, 2025

There is a bug in llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp where StmtSeqVal was being compared against UINT32_MAX rather than the correct UINT64_MAX - thanks @nocchijiang for pointing this out.

We correct the issue with this patch. For testing - the issue would show when we have a correct offset of value UINT32_MAX - but constructing such a test is impractical.

@alx32 alx32 requested review from clayborg and kyulee-com March 13, 2025 19:39
@alx32 alx32 marked this pull request as ready for review March 13, 2025 19:41
@llvmbot
Copy link
Member

llvmbot commented Mar 13, 2025

@llvm/pr-subscribers-debuginfo

Author: None (alx32)

Changes

There is a bug in llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp where StmtSeqVal was being compared against UINT32_MAX rather than the correct UINT64_MAX - thanks @nocchijiang for pointing this out.

We correct the issue with this patch. For testing - the issue would show when we have a correct offset of value UINT32_MAX - but constructing such a test is impractical.


Full diff: https://github.com/llvm/llvm-project/pull/131197.diff

1 Files Affected:

  • (modified) llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp (+2-2)
diff --git a/llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp b/llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
index ea989767d111c..290caa5f10782 100644
--- a/llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
+++ b/llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
@@ -324,8 +324,8 @@ static void convertFunctionLineTable(OutputAggregator &Out, CUInfo &CUI,
     // when it refers to an empty line sequence. In such cases, the DWARF linker
     // will exclude the empty sequence from the final output and assign
     // `UINT64_MAX` to the `DW_AT_LLVM_stmt_sequence` attribute.
-    auto StmtSeqVal = dwarf::toSectionOffset(StmtSeqAttr, UINT64_MAX);
-    if (StmtSeqVal != UINT32_MAX)
+    uint64_t StmtSeqVal = dwarf::toSectionOffset(StmtSeqAttr, UINT64_MAX);
+    if (StmtSeqVal != UINT64_MAX)
       StmtSeqOffset = StmtSeqVal;
   }
 

@alx32 alx32 requested a review from DataCorrupted March 14, 2025 01:26
@alx32 alx32 merged commit 8c31bb7 into llvm:main Mar 14, 2025
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants