diff --git a/qemu/target-arm/translate-a64.c b/qemu/target-arm/translate-a64.c index d5ff3ad4..66d5eacf 100644 --- a/qemu/target-arm/translate-a64.c +++ b/qemu/target-arm/translate-a64.c @@ -2698,11 +2698,12 @@ static void disas_pc_rel_adr(DisasContext *s, uint32_t insn) TCGContext *tcg_ctx = s->uc->tcg_ctx; unsigned int page, rd; uint64_t base; - int64_t offset; + uint64_t offset; page = extract32(insn, 31, 1); /* SignExtend(immhi:immlo) -> offset */ - offset = ((int64_t)sextract32(insn, 5, 19) << 2) | extract32(insn, 29, 2); + offset = sextract64(insn, 5, 19); + offset = offset << 2 | extract32(insn, 29, 2); rd = extract32(insn, 0, 5); base = s->pc - 4;