From 2e3a79dfca57dee4768cc7d5dc3b08919bd8fb4d Mon Sep 17 00:00:00 2001 From: Rahman Lavaee Date: Tue, 12 Nov 2024 06:24:00 +0000 Subject: [PATCH] [NFC,SHT_LLVM_BB_ADDR_MAP] Fix ub in ELF.cpp. --- llvm/lib/Object/ELF.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Object/ELF.cpp b/llvm/lib/Object/ELF.cpp index 9a9e762d1e51d..545a672c05c8a 100644 --- a/llvm/lib/Object/ELF.cpp +++ b/llvm/lib/Object/ELF.cpp @@ -823,7 +823,6 @@ decodeBBAddrMapImpl(const ELFFile &EF, uint32_t NumBlocksInBBRange = 0; uint32_t NumBBRanges = 1; typename ELFFile::uintX_t RangeBaseAddress = 0; - std::vector BBEntries; if (FeatEnable.MultiBBRange) { NumBBRanges = readULEB128As(Data, Cur, ULEBSizeErr); if (!Cur || ULEBSizeErr) @@ -851,6 +850,7 @@ decodeBBAddrMapImpl(const ELFFile &EF, RangeBaseAddress = *AddressOrErr; NumBlocksInBBRange = readULEB128As(Data, Cur, ULEBSizeErr); } + std::vector BBEntries; for (uint32_t BlockIndex = 0; !MetadataDecodeErr && !ULEBSizeErr && Cur && (BlockIndex < NumBlocksInBBRange); ++BlockIndex) {