diff --git a/qemu/target/arm/translate-a64.c b/qemu/target/arm/translate-a64.c index 7d308e41..3e3263b1 100644 --- a/qemu/target/arm/translate-a64.c +++ b/qemu/target/arm/translate-a64.c @@ -7683,7 +7683,7 @@ static void handle_simd_dupe(DisasContext *s, int is_q, int rd, int rn, { TCGContext *tcg_ctx = s->uc->tcg_ctx; int size = ctz32(imm5); - int index = imm5 >> (size + 1); + int index; if (size > 3 || (size == 3 && !is_q)) { unallocated_encoding(s); @@ -7694,6 +7694,7 @@ static void handle_simd_dupe(DisasContext *s, int is_q, int rd, int rn, return; } + index = imm5 >> (size + 1); tcg_gen_gvec_dup_mem(tcg_ctx, size, vec_full_reg_offset(s, rd), vec_reg_offset(s, rn, index, size), is_q ? 16 : 8, vec_full_reg_size(s));