]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Fix IR_BUFHDR assembly.
authorMike Pall <mike>
Thu, 3 Jun 2021 08:05:20 +0000 (10:05 +0200)
committerMike Pall <mike>
Thu, 3 Jun 2021 08:05:20 +0000 (10:05 +0200)
src/lj_asm.c

index 319ba8379ff246de138c1e7d87c2a59d50b8c1ba..b613e6d3c17f89dc764cf1ded9471bb014ce7969 100644 (file)
@@ -1163,9 +1163,10 @@ static void asm_bufhdr(ASMState *as, IRIns *ir)
     }
   } else {
     Reg tmp = ra_scratch(as, rset_exclude(RSET_GPR, sb));
-    /* Passing ir isn't strictly correct, but it's an IRT_PGC, too. */
-    emit_storeofs(as, ir, tmp, sb, offsetof(SBuf, w));
-    emit_loadofs(as, ir, tmp, sb, offsetof(SBuf, b));
+    IRIns irbp;
+    irbp.ot = IRT(0, IRT_PTR);  /* Buffer data pointer type. */
+    emit_storeofs(as, &irbp, tmp, sb, offsetof(SBuf, w));
+    emit_loadofs(as, &irbp, tmp, sb, offsetof(SBuf, b));
   }
 #if LJ_TARGET_X86ORX64
   ra_left(as, sb, ir->op1);