diff options
author | Mike Pall <mike> | 2019-08-30 12:16:50 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2019-08-30 12:16:50 +0200 |
commit | 8755e0b74b71b4e26e31caa9fe8e0a3de8364c21 (patch) | |
tree | 4544cb4829a76c08ae5fc40e4162c4abfd5d3c07 /src/lj_ir.h | |
parent | 88d40b00c38611412d0023d7ed55999615deb55b (diff) | |
download | luajit-8755e0b74b71b4e26e31caa9fe8e0a3de8364c21.tar.gz luajit-8755e0b74b71b4e26e31caa9fe8e0a3de8364c21.tar.bz2 luajit-8755e0b74b71b4e26e31caa9fe8e0a3de8364c21.zip |
Fix unsinking of 64 bit constants.
Contributed by Thibault Charbonnier.
Diffstat (limited to 'src/lj_ir.h')
-rw-r--r-- | src/lj_ir.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lj_ir.h b/src/lj_ir.h index 8057a750..ae889850 100644 --- a/src/lj_ir.h +++ b/src/lj_ir.h | |||
@@ -562,6 +562,11 @@ typedef union IRIns { | |||
562 | TValue tv; /* TValue constant (overlaps entire slot). */ | 562 | TValue tv; /* TValue constant (overlaps entire slot). */ |
563 | } IRIns; | 563 | } IRIns; |
564 | 564 | ||
565 | #define ir_isk64(ir) \ | ||
566 | ((ir)->o == IR_KNUM || (ir)->o == IR_KINT64 || \ | ||
567 | (LJ_GC64 && \ | ||
568 | ((ir)->o == IR_KGC || (ir)->o == IR_KPTR || (ir)->o == IR_KKPTR))) | ||
569 | |||
565 | #define ir_kgc(ir) check_exp((ir)->o == IR_KGC, gcref((ir)[LJ_GC64].gcr)) | 570 | #define ir_kgc(ir) check_exp((ir)->o == IR_KGC, gcref((ir)[LJ_GC64].gcr)) |
566 | #define ir_kstr(ir) (gco2str(ir_kgc((ir)))) | 571 | #define ir_kstr(ir) (gco2str(ir_kgc((ir)))) |
567 | #define ir_ktab(ir) (gco2tab(ir_kgc((ir)))) | 572 | #define ir_ktab(ir) (gco2tab(ir_kgc((ir)))) |
@@ -569,12 +574,7 @@ typedef union IRIns { | |||
569 | #define ir_kcdata(ir) (gco2cd(ir_kgc((ir)))) | 574 | #define ir_kcdata(ir) (gco2cd(ir_kgc((ir)))) |
570 | #define ir_knum(ir) check_exp((ir)->o == IR_KNUM, &(ir)[1].tv) | 575 | #define ir_knum(ir) check_exp((ir)->o == IR_KNUM, &(ir)[1].tv) |
571 | #define ir_kint64(ir) check_exp((ir)->o == IR_KINT64, &(ir)[1].tv) | 576 | #define ir_kint64(ir) check_exp((ir)->o == IR_KINT64, &(ir)[1].tv) |
572 | #define ir_k64(ir) \ | 577 | #define ir_k64(ir) check_exp(ir_isk64(ir), &(ir)[1].tv) |
573 | check_exp((ir)->o == IR_KNUM || (ir)->o == IR_KINT64 || \ | ||
574 | (LJ_GC64 && \ | ||
575 | ((ir)->o == IR_KGC || \ | ||
576 | (ir)->o == IR_KPTR || (ir)->o == IR_KKPTR)), \ | ||
577 | &(ir)[1].tv) | ||
578 | #define ir_kptr(ir) \ | 578 | #define ir_kptr(ir) \ |
579 | check_exp((ir)->o == IR_KPTR || (ir)->o == IR_KKPTR, \ | 579 | check_exp((ir)->o == IR_KPTR || (ir)->o == IR_KKPTR, \ |
580 | mref((ir)[LJ_GC64].ptr, void)) | 580 | mref((ir)[LJ_GC64].ptr, void)) |