[llvm] 275bec4 - Revert "[LEB128] Don't handle edge cases in every loop iteration"
Adrian Prantl via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 29 12:40:48 PST 2023
Author: Adrian Prantl
Date: 2023-11-29T12:40:37-08:00
New Revision: 275bec486f68cc027d121e3ff8f807086cdf4902
URL: https://github.com/llvm/llvm-project/commit/275bec486f68cc027d121e3ff8f807086cdf4902
DIFF: https://github.com/llvm/llvm-project/commit/275bec486f68cc027d121e3ff8f807086cdf4902.diff
LOG: Revert "[LEB128] Don't handle edge cases in every loop iteration"
This reverts commit 0cc2acc30b3d2f4e914fd49c599cfde8a17f26a6.
Added:
Modified:
llvm/include/llvm/Support/LEB128.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/Support/LEB128.h b/llvm/include/llvm/Support/LEB128.h
index 40b6cf79bacf758..76c93acaadfdcc7 100644
--- a/llvm/include/llvm/Support/LEB128.h
+++ b/llvm/include/llvm/Support/LEB128.h
@@ -142,8 +142,7 @@ inline uint64_t decodeULEB128(const uint8_t *p, unsigned *n = nullptr,
break;
}
uint64_t Slice = *p & 0x7f;
- if (Shift >= 63 && ((Shift == 63 && (Slice << Shift >> Shift) != Slice) ||
- (Shift > 63 && Slice != 0))) {
+ if ((Shift >= 64 && Slice != 0) || Slice << Shift >> Shift != Slice) {
if (error)
*error = "uleb128 too big for uint64";
Value = 0;
@@ -178,8 +177,8 @@ inline int64_t decodeSLEB128(const uint8_t *p, unsigned *n = nullptr,
}
Byte = *p;
uint64_t Slice = Byte & 0x7f;
- if ((Shift >= 63) && ((Shift == 63 && Slice != 0 && Slice != 0x7f) ||
- (Shift > 63 && Slice != (Value < 0 ? 0x7f : 0x00)))) {
+ if ((Shift >= 64 && Slice != (Value < 0 ? 0x7f : 0x00)) ||
+ (Shift == 63 && Slice != 0 && Slice != 0x7f)) {
if (error)
*error = "sleb128 too big for int64";
if (n)
More information about the llvm-commits
mailing list