diff options
| author | Mike Pall <mike> | 2017-03-30 11:35:29 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2017-03-30 11:35:29 +0200 |
| commit | e205ad0c5533c0a538596b63cf12d3fd0e4cc8f2 (patch) | |
| tree | 083b749d14e2de90a70af80de37491eedcaa01a9 /src | |
| parent | f50bf7585a32738c4fb719cb8fc59d02231fc8c3 (diff) | |
| download | luajit-e205ad0c5533c0a538596b63cf12d3fd0e4cc8f2.tar.gz luajit-e205ad0c5533c0a538596b63cf12d3fd0e4cc8f2.tar.bz2 luajit-e205ad0c5533c0a538596b63cf12d3fd0e4cc8f2.zip | |
FFI: Fix FOLD rules for int64_t comparisons.
Thanks to Peter Cawley.
Diffstat (limited to '')
| -rw-r--r-- | src/lj_opt_fold.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lj_opt_fold.c b/src/lj_opt_fold.c index b2d35c42..3d0e35a6 100644 --- a/src/lj_opt_fold.c +++ b/src/lj_opt_fold.c | |||
| @@ -444,14 +444,14 @@ LJFOLDF(kfold_int64comp) | |||
| 444 | #if LJ_HASFFI | 444 | #if LJ_HASFFI |
| 445 | uint64_t a = ir_k64(fleft)->u64, b = ir_k64(fright)->u64; | 445 | uint64_t a = ir_k64(fleft)->u64, b = ir_k64(fright)->u64; |
| 446 | switch ((IROp)fins->o) { | 446 | switch ((IROp)fins->o) { |
| 447 | case IR_LT: return CONDFOLD(a < b); | 447 | case IR_LT: return CONDFOLD((int64_t)a < (int64_t)b); |
| 448 | case IR_GE: return CONDFOLD(a >= b); | 448 | case IR_GE: return CONDFOLD((int64_t)a >= (int64_t)b); |
| 449 | case IR_LE: return CONDFOLD(a <= b); | 449 | case IR_LE: return CONDFOLD((int64_t)a <= (int64_t)b); |
| 450 | case IR_GT: return CONDFOLD(a > b); | 450 | case IR_GT: return CONDFOLD((int64_t)a > (int64_t)b); |
| 451 | case IR_ULT: return CONDFOLD((uint64_t)a < (uint64_t)b); | 451 | case IR_ULT: return CONDFOLD(a < b); |
| 452 | case IR_UGE: return CONDFOLD((uint64_t)a >= (uint64_t)b); | 452 | case IR_UGE: return CONDFOLD(a >= b); |
| 453 | case IR_ULE: return CONDFOLD((uint64_t)a <= (uint64_t)b); | 453 | case IR_ULE: return CONDFOLD(a <= b); |
| 454 | case IR_UGT: return CONDFOLD((uint64_t)a > (uint64_t)b); | 454 | case IR_UGT: return CONDFOLD(a > b); |
| 455 | default: lua_assert(0); return FAILFOLD; | 455 | default: lua_assert(0); return FAILFOLD; |
| 456 | } | 456 | } |
| 457 | #else | 457 | #else |
