Skip to content
Permalink
Browse files
8263425: AArch64: two potential bugs in C1 LIRGenerator::generate_add…
…ress()

Reviewed-by: aph
  • Loading branch information
nick-arm committed Mar 15, 2021
1 parent 554dd29 commit f7e0a09802f74e6432d170e6a00dc75cd053047b
Showing 1 changed file with 2 additions and 2 deletions.
@@ -174,7 +174,7 @@ LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index,
if (large_disp != 0) {
LIR_Opr tmp = new_pointer_register();
if (Assembler::operand_valid_for_add_sub_immediate(large_disp)) {
__ add(tmp, tmp, LIR_OprFact::intptrConst(large_disp));
__ add(index, LIR_OprFact::intptrConst(large_disp), tmp);
index = tmp;
} else {
__ move(tmp, LIR_OprFact::intptrConst(large_disp));
@@ -191,7 +191,7 @@ LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index,
}

// at this point we either have base + index or base + displacement
if (large_disp == 0) {
if (large_disp == 0 && index->is_register()) {
return new LIR_Address(base, index, type);
} else {
assert(Address::offset_ok_for_immed(large_disp, 0), "must be");

0 comments on commit f7e0a09

Please sign in to comment.