Skip to content

Commit

Permalink
target-arm: A64: Avoid signed shifts in disas_ldst_pair()
Browse files Browse the repository at this point in the history
Avoid shifting potentially negative signed offset values in
disas_ldst_pair() by keeping the offset in a uint64_t rather
than an int64_t.

Signed-off-by: Peter Maydell <[email protected]>
Message-id: [email protected]
  • Loading branch information
pm215 committed Feb 13, 2015
1 parent 037e1d0 commit c2ebd86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion target-arm/translate-a64.c
Original file line number Diff line number Diff line change
Expand Up @@ -1917,7 +1917,7 @@ static void disas_ldst_pair(DisasContext *s, uint32_t insn)
int rt = extract32(insn, 0, 5);
int rn = extract32(insn, 5, 5);
int rt2 = extract32(insn, 10, 5);
int64_t offset = sextract32(insn, 15, 7);
uint64_t offset = sextract64(insn, 15, 7);
int index = extract32(insn, 23, 2);
bool is_vector = extract32(insn, 26, 1);
bool is_load = extract32(insn, 22, 1);
Expand Down

0 comments on commit c2ebd86

Please sign in to comment.