Skip to content

Commit 275fd96

Browse files
author
git apple-llvm automerger
committed
Merge commit 'edbe7fa5fef9' from llvm.org/release/18.x into stable/20240123
2 parents 8c8c772 + edbe7fa commit 275fd96

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lld/ELF/Arch/LoongArch.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,9 @@ static bool isJirl(uint32_t insn) {
159159
static void handleUleb128(uint8_t *loc, uint64_t val) {
160160
const uint32_t maxcount = 1 + 64 / 7;
161161
uint32_t count;
162-
uint64_t orig = decodeULEB128(loc, &count);
163-
if (count > maxcount)
162+
const char *error = nullptr;
163+
uint64_t orig = decodeULEB128(loc, &count, nullptr, &error);
164+
if (count > maxcount || (count == maxcount && error))
164165
errorOrWarn(getErrorLocation(loc) + "extra space for uleb128");
165166
uint64_t mask = count < maxcount ? (1ULL << 7 * count) - 1 : -1ULL;
166167
encodeULEB128((orig + val) & mask, loc, count);

0 commit comments

Comments
 (0)