< prev index next >

src/cpu/ppc/vm/macroAssembler_ppc.cpp

Print this page

        

@@ -153,11 +153,11 @@
   }
 
   assert(is_addis(inst1) && inv_ra_field(inst1) == 29 /* R29 */, "source must be global TOC");
   set_imm((int *)inst1_addr, MacroAssembler::largeoffset_si16_si16_hi(offset));
   set_imm((int *)inst2_addr, MacroAssembler::largeoffset_si16_si16_lo(offset));
-  return (int)((intptr_t)addr - (intptr_t)inst1_addr);
+  return (int)((intptr_t)inst2_addr - (intptr_t)inst1_addr);
 }
 
 address MacroAssembler::get_address_of_calculate_address_from_global_toc_at(address a, address bound) {
   const address inst2_addr = a;
   const int inst2 = *(int *)inst2_addr;
< prev index next >