diff options
Diffstat (limited to 'src/lj_record.c')
-rw-r--r-- | src/lj_record.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lj_record.c b/src/lj_record.c index 02016b12..0dfd1f73 100644 --- a/src/lj_record.c +++ b/src/lj_record.c | |||
@@ -790,8 +790,8 @@ static TRef rec_upvalue(jit_State *J, uint32_t uv, TRef val) | |||
790 | int needbarrier = 0; | 790 | int needbarrier = 0; |
791 | if (!uvp->closed) { | 791 | if (!uvp->closed) { |
792 | /* In current stack? */ | 792 | /* In current stack? */ |
793 | if (uvp->v >= J->L->stack && uvp->v < J->L->maxstack) { | 793 | if (uvval(uvp) >= J->L->stack && uvval(uvp) < J->L->maxstack) { |
794 | int32_t slot = (int32_t)(uvp->v - (J->L->base - J->baseslot)); | 794 | int32_t slot = (int32_t)(uvval(uvp) - (J->L->base - J->baseslot)); |
795 | if (slot >= 0) { /* Aliases an SSA slot? */ | 795 | if (slot >= 0) { /* Aliases an SSA slot? */ |
796 | slot -= (int32_t)J->baseslot; /* Note: slot number may be negative! */ | 796 | slot -= (int32_t)J->baseslot; /* Note: slot number may be negative! */ |
797 | /* NYI: add IR to guard that it's still aliasing the same slot. */ | 797 | /* NYI: add IR to guard that it's still aliasing the same slot. */ |
@@ -810,7 +810,7 @@ static TRef rec_upvalue(jit_State *J, uint32_t uv, TRef val) | |||
810 | uref = tref_ref(emitir(IRTG(IR_UREFC, IRT_PTR), fn, uv)); | 810 | uref = tref_ref(emitir(IRTG(IR_UREFC, IRT_PTR), fn, uv)); |
811 | } | 811 | } |
812 | if (val == 0) { /* Upvalue load */ | 812 | if (val == 0) { /* Upvalue load */ |
813 | IRType t = itype2irt(uvp->v); | 813 | IRType t = itype2irt(uvval(uvp)); |
814 | TRef res = emitir(IRTG(IR_ULOAD, t), uref, 0); | 814 | TRef res = emitir(IRTG(IR_ULOAD, t), uref, 0); |
815 | if (irtype_ispri(t)) res = TREF_PRI(t); /* Canonicalize primitive refs. */ | 815 | if (irtype_ispri(t)) res = TREF_PRI(t); /* Canonicalize primitive refs. */ |
816 | return res; | 816 | return res; |