diff options
author | Mike Pall <mike> | 2016-04-24 17:32:12 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2016-04-24 17:32:12 +0200 |
commit | ac42037db0ea0e0c8f4934b5103db522ab405129 (patch) | |
tree | be659548215b60726dfd6f34c1fdf545d81a7b1a /src/lj_record.c | |
parent | d8ac6230ed95a60b79e58a4aa2ba7f6d0b132e9e (diff) | |
download | luajit-ac42037db0ea0e0c8f4934b5103db522ab405129.tar.gz luajit-ac42037db0ea0e0c8f4934b5103db522ab405129.tar.bz2 luajit-ac42037db0ea0e0c8f4934b5103db522ab405129.zip |
Constrain value range of lj_ir_kptr() to unsigned 32 bit pointers.
Thanks to Peter Cawley.
Diffstat (limited to 'src/lj_record.c')
-rw-r--r-- | src/lj_record.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/lj_record.c b/src/lj_record.c index 306a85cb..8a72b0c9 100644 --- a/src/lj_record.c +++ b/src/lj_record.c | |||
@@ -882,12 +882,7 @@ void lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults) | |||
882 | static BCReg rec_mm_prep(jit_State *J, ASMFunction cont) | 882 | static BCReg rec_mm_prep(jit_State *J, ASMFunction cont) |
883 | { | 883 | { |
884 | BCReg s, top = cont == lj_cont_cat ? J->maxslot : curr_proto(J->L)->framesize; | 884 | BCReg s, top = cont == lj_cont_cat ? J->maxslot : curr_proto(J->L)->framesize; |
885 | #if LJ_64 | 885 | J->base[top] = lj_ir_kptr(J, contptr(cont)) | TREF_CONT; |
886 | TRef trcont = lj_ir_kptr(J, (void *)((int64_t)cont-(int64_t)lj_vm_asm_begin)); | ||
887 | #else | ||
888 | TRef trcont = lj_ir_kptr(J, (void *)cont); | ||
889 | #endif | ||
890 | J->base[top] = trcont | TREF_CONT; | ||
891 | J->framedepth++; | 886 | J->framedepth++; |
892 | for (s = J->maxslot; s < top; s++) | 887 | for (s = J->maxslot; s < top; s++) |
893 | J->base[s] = 0; /* Clear frame gap to avoid resurrecting previous refs. */ | 888 | J->base[s] = 0; /* Clear frame gap to avoid resurrecting previous refs. */ |