We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8c8c772 + edbe7fa commit 275fd96Copy full SHA for 275fd96
lld/ELF/Arch/LoongArch.cpp
@@ -159,8 +159,9 @@ static bool isJirl(uint32_t insn) {
159
static void handleUleb128(uint8_t *loc, uint64_t val) {
160
const uint32_t maxcount = 1 + 64 / 7;
161
uint32_t count;
162
- uint64_t orig = decodeULEB128(loc, &count);
163
- if (count > maxcount)
+ const char *error = nullptr;
+ uint64_t orig = decodeULEB128(loc, &count, nullptr, &error);
164
+ if (count > maxcount || (count == maxcount && error))
165
errorOrWarn(getErrorLocation(loc) + "extra space for uleb128");
166
uint64_t mask = count < maxcount ? (1ULL << 7 * count) - 1 : -1ULL;
167
encodeULEB128((orig + val) & mask, loc, count);
0 commit comments