[llvm] 6861b01 - [DWARFYAML] Declare `OffsetEntryCount` as `uint64_t` (#224631)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 28 05:10:33 PDT 2026
Author: Igor Wodiany
Date: 2026-09-28T13:10:26+01:00
New Revision: 6861b01646bd770523e94f3efe572f598cfdcc53
URL: https://github.com/llvm/llvm-project/commit/6861b01646bd770523e94f3efe572f598cfdcc53
DIFF: https://github.com/llvm/llvm-project/commit/6861b01646bd770523e94f3efe572f598cfdcc53.diff
LOG: [DWARFYAML] Declare `OffsetEntryCount` as `uint64_t` (#224631)
This prevents a potential multiplication overflow when `OffsetsSize` is
calculated and fixes an issue reported by a CodeQL scan.
Added:
Modified:
llvm/lib/ObjectYAML/DWARFEmitter.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ObjectYAML/DWARFEmitter.cpp b/llvm/lib/ObjectYAML/DWARFEmitter.cpp
index 5e117e87e5011..12188af6b4883 100644
--- a/llvm/lib/ObjectYAML/DWARFEmitter.cpp
+++ b/llvm/lib/ObjectYAML/DWARFEmitter.cpp
@@ -1235,7 +1235,7 @@ static Error writeDWARFLists(raw_ostream &OS,
// from the 'Offsets' field in the YAML description. If the 'Offsets' field
// isn't specified either, yaml2obj will infer it from the auto-generated
// offsets.
- uint32_t OffsetEntryCount;
+ uint64_t OffsetEntryCount;
if (Table.OffsetEntryCount)
OffsetEntryCount = *Table.OffsetEntryCount;
else
More information about the llvm-commits
mailing list