From 3e9f6433c838cad88f0d97b3ac9f2aa402b83720 Mon Sep 17 00:00:00 2001 From: Mark Rowe Date: Wed, 30 Jul 2025 09:34:54 -0700 Subject: [ARM64] Fix lifting of tbz / tbnz for bits >= 32 --- arch/arm64/il.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/il.cpp b/arch/arm64/il.cpp index 6dd1afe1..2d3cb8bc 100644 --- a/arch/arm64/il.cpp +++ b/arch/arm64/il.cpp @@ -1159,13 +1159,13 @@ static ExprId ExtractBits( LowLevelILFunction& il, InstructionOperand& reg, size_t nbits, size_t rightMostBit) { // Get N set bits at offset O -#define BITMASK(N, O) (((1LL << nbits) - 1) << O) +#define BITMASK(N, O) (((UINT64_C(1) << nbits) - 1) << O) return il.And(REGSZ_O(reg), ILREG_O(reg), il.Const(REGSZ_O(reg), BITMASK(nbits, rightMostBit))); } static ExprId ExtractBit(LowLevelILFunction& il, InstructionOperand& reg, size_t bit) { - return il.And(REGSZ_O(reg), ILREG_O(reg), il.Const(REGSZ_O(reg), (1 << bit))); + return il.And(REGSZ_O(reg), ILREG_O(reg), il.Const(REGSZ_O(reg), (UINT64_C(1) << bit))); } static void ConditionalJump(Architecture* arch, LowLevelILFunction& il, size_t cond, -- cgit v1.3.1