Skip to content

Commit 2e3a79d

Browse files
committed
[NFC,SHT_LLVM_BB_ADDR_MAP] Fix ub in ELF.cpp.
1 parent f77101e commit 2e3a79d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Object/ELF.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,6 @@ decodeBBAddrMapImpl(const ELFFile<ELFT> &EF,
823823
uint32_t NumBlocksInBBRange = 0;
824824
uint32_t NumBBRanges = 1;
825825
typename ELFFile<ELFT>::uintX_t RangeBaseAddress = 0;
826-
std::vector<BBAddrMap::BBEntry> BBEntries;
827826
if (FeatEnable.MultiBBRange) {
828827
NumBBRanges = readULEB128As<uint32_t>(Data, Cur, ULEBSizeErr);
829828
if (!Cur || ULEBSizeErr)
@@ -851,6 +850,7 @@ decodeBBAddrMapImpl(const ELFFile<ELFT> &EF,
851850
RangeBaseAddress = *AddressOrErr;
852851
NumBlocksInBBRange = readULEB128As<uint32_t>(Data, Cur, ULEBSizeErr);
853852
}
853+
std::vector<BBAddrMap::BBEntry> BBEntries;
854854
for (uint32_t BlockIndex = 0; !MetadataDecodeErr && !ULEBSizeErr && Cur &&
855855
(BlockIndex < NumBlocksInBBRange);
856856
++BlockIndex) {

0 commit comments

Comments
 (0)