mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-08 07:34:07 +00:00
Fix unsinking of 64 bit constants.
Contributed by Thibault Charbonnier.
This commit is contained in:
parent
88d40b00c3
commit
8755e0b74b
12
src/lj_ir.h
12
src/lj_ir.h
@ -562,6 +562,11 @@ typedef union IRIns {
|
|||||||
TValue tv; /* TValue constant (overlaps entire slot). */
|
TValue tv; /* TValue constant (overlaps entire slot). */
|
||||||
} IRIns;
|
} IRIns;
|
||||||
|
|
||||||
|
#define ir_isk64(ir) \
|
||||||
|
((ir)->o == IR_KNUM || (ir)->o == IR_KINT64 || \
|
||||||
|
(LJ_GC64 && \
|
||||||
|
((ir)->o == IR_KGC || (ir)->o == IR_KPTR || (ir)->o == IR_KKPTR)))
|
||||||
|
|
||||||
#define ir_kgc(ir) check_exp((ir)->o == IR_KGC, gcref((ir)[LJ_GC64].gcr))
|
#define ir_kgc(ir) check_exp((ir)->o == IR_KGC, gcref((ir)[LJ_GC64].gcr))
|
||||||
#define ir_kstr(ir) (gco2str(ir_kgc((ir))))
|
#define ir_kstr(ir) (gco2str(ir_kgc((ir))))
|
||||||
#define ir_ktab(ir) (gco2tab(ir_kgc((ir))))
|
#define ir_ktab(ir) (gco2tab(ir_kgc((ir))))
|
||||||
@ -569,12 +574,7 @@ typedef union IRIns {
|
|||||||
#define ir_kcdata(ir) (gco2cd(ir_kgc((ir))))
|
#define ir_kcdata(ir) (gco2cd(ir_kgc((ir))))
|
||||||
#define ir_knum(ir) check_exp((ir)->o == IR_KNUM, &(ir)[1].tv)
|
#define ir_knum(ir) check_exp((ir)->o == IR_KNUM, &(ir)[1].tv)
|
||||||
#define ir_kint64(ir) check_exp((ir)->o == IR_KINT64, &(ir)[1].tv)
|
#define ir_kint64(ir) check_exp((ir)->o == IR_KINT64, &(ir)[1].tv)
|
||||||
#define ir_k64(ir) \
|
#define ir_k64(ir) check_exp(ir_isk64(ir), &(ir)[1].tv)
|
||||||
check_exp((ir)->o == IR_KNUM || (ir)->o == IR_KINT64 || \
|
|
||||||
(LJ_GC64 && \
|
|
||||||
((ir)->o == IR_KGC || \
|
|
||||||
(ir)->o == IR_KPTR || (ir)->o == IR_KKPTR)), \
|
|
||||||
&(ir)[1].tv)
|
|
||||||
#define ir_kptr(ir) \
|
#define ir_kptr(ir) \
|
||||||
check_exp((ir)->o == IR_KPTR || (ir)->o == IR_KKPTR, \
|
check_exp((ir)->o == IR_KPTR || (ir)->o == IR_KKPTR, \
|
||||||
mref((ir)[LJ_GC64].ptr, void))
|
mref((ir)[LJ_GC64].ptr, void))
|
||||||
|
@ -688,7 +688,7 @@ static void snap_restoredata(GCtrace *T, ExitState *ex,
|
|||||||
int32_t *src;
|
int32_t *src;
|
||||||
uint64_t tmp;
|
uint64_t tmp;
|
||||||
if (irref_isk(ref)) {
|
if (irref_isk(ref)) {
|
||||||
if (ir->o == IR_KNUM || ir->o == IR_KINT64) {
|
if (ir_isk64(ir)) {
|
||||||
src = (int32_t *)&ir[1];
|
src = (int32_t *)&ir[1];
|
||||||
} else if (sz == 8) {
|
} else if (sz == 8) {
|
||||||
tmp = (uint64_t)(uint32_t)ir->i;
|
tmp = (uint64_t)(uint32_t)ir->i;
|
||||||
|
Loading…
Reference in New Issue
Block a user