Skip to content

Commit 3e9f643

Browse files
committed
[ARM64] Fix lifting of tbz / tbnz for bits >= 32
1 parent 3697935 commit 3e9f643

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/arm64/il.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,13 +1159,13 @@ static ExprId ExtractBits(
11591159
LowLevelILFunction& il, InstructionOperand& reg, size_t nbits, size_t rightMostBit)
11601160
{
11611161
// Get N set bits at offset O
1162-
#define BITMASK(N, O) (((1LL << nbits) - 1) << O)
1162+
#define BITMASK(N, O) (((UINT64_C(1) << nbits) - 1) << O)
11631163
return il.And(REGSZ_O(reg), ILREG_O(reg), il.Const(REGSZ_O(reg), BITMASK(nbits, rightMostBit)));
11641164
}
11651165

11661166
static ExprId ExtractBit(LowLevelILFunction& il, InstructionOperand& reg, size_t bit)
11671167
{
1168-
return il.And(REGSZ_O(reg), ILREG_O(reg), il.Const(REGSZ_O(reg), (1 << bit)));
1168+
return il.And(REGSZ_O(reg), ILREG_O(reg), il.Const(REGSZ_O(reg), (UINT64_C(1) << bit)));
11691169
}
11701170

11711171
static void ConditionalJump(Architecture* arch, LowLevelILFunction& il, size_t cond,

0 commit comments

Comments
 (0)