Browse Source

Fold KPTR + offset in SPLIT pass.

Mike Pall 13 years ago
parent
commit
d4d9807f45
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/lj_opt_split.c

+ 2 - 0
src/lj_opt_split.c

@@ -184,6 +184,8 @@ static IRRef split_ptr(jit_State *J, IRIns *oir, IRRef ref)
   IRRef nref = oir[ref].prev;
   IRIns *ir = IR(nref);
   int32_t ofs = 4;
+  if (ir->o == IR_KPTR)
+    return lj_ir_kptr(J, (char *)ir_kptr(ir) + ofs);
   if (ir->o == IR_ADD && irref_isk(ir->op2) && !irt_isphi(oir[ref].t)) {
     /* Reassociate address. */
     ofs += IR(ir->op2)->i;