]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
PPC: Fix GG_State loads.
authorMike Pall <mike>
Mon, 22 Mar 2021 23:28:03 +0000 (00:28 +0100)
committerMike Pall <mike>
Mon, 22 Mar 2021 23:28:03 +0000 (00:28 +0100)
src/lj_asm_ppc.h
src/lj_ir.c

index 579f8e2afdbf71c9adfb231ff77e9c56ab33c640..88869d9d7d970ca2a4638ba4ac79c8116d586b0b 100644 (file)
@@ -894,7 +894,7 @@ static void asm_fload(ASMState *as, IRIns *ir)
   int32_t ofs;
   if (ir->op1 == REF_NIL) {  /* FLOAD from GG_State with offset. */
     idx = RID_JGL;
-    ofs = (ir->op2 << 2) - 32768;
+    ofs = (ir->op2 << 2) - 32768 - GG_OFS(g);
   } else {
     idx = ra_alloc1(as, ir->op1, RSET_GPR);
     if (ir->op2 == IRFL_TAB_ARRAY) {
index 4be11a61d07fae9503858750b9a5f8673fa6c2c2..29d75d26ac7672acb98a28a96e1e3c2c34610b23 100644 (file)
@@ -147,7 +147,7 @@ TRef lj_ir_call(jit_State *J, IRCallID id, ...)
 }
 
 /* Load field of type t from GG_State + offset. Must be 32 bit aligned. */
-LJ_FUNC TRef lj_ir_ggfload(jit_State *J, IRType t, uintptr_t ofs)
+TRef lj_ir_ggfload(jit_State *J, IRType t, uintptr_t ofs)
 {
   lj_assertJ((ofs & 3) == 0, "unaligned GG_State field offset");
   ofs >>= 2;