Fix narrow_icmp_imm (#1343)

This commit is contained in:
jmkrauz
2020-01-21 15:20:44 +01:00
committed by Benjamin Bouvier
parent 175b9641e0
commit ae6ba1e58c
2 changed files with 56 additions and 1 deletions

View File

@@ -702,7 +702,7 @@ fn narrow_icmp_imm(
let imm_low = pos
.ins()
.iconst(ty_half, imm & (1u128 << (ty_half.bits() - 1)) as i64);
.iconst(ty_half, imm & ((1u128 << ty_half.bits()) - 1) as i64);
let imm_high = pos
.ins()
.iconst(ty_half, imm.wrapping_shr(ty_half.bits().into()));