Skip to content

Commit

Permalink
Fix IR_BUFHDR assembly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Pall committed Jun 3, 2021
1 parent 1b7171c commit 65ff33a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lj_asm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 65ff33a

Please sign in to comment.