diff options
| author | Mike Pall <mike> | 2020-05-22 03:28:52 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2020-05-22 03:28:52 +0200 |
| commit | 2f3f07882fb4ad9c64967d7088461b1ca0a25d3a (patch) | |
| tree | 5cc6dbd0f7d2b60f08202bca84b7422b404e5bc5 /src | |
| parent | cc4bbec483d3f3250b519ccb7cc22f1a8e6fe6f0 (diff) | |
| download | luajit-2f3f07882fb4ad9c64967d7088461b1ca0a25d3a.tar.gz luajit-2f3f07882fb4ad9c64967d7088461b1ca0a25d3a.tar.bz2 luajit-2f3f07882fb4ad9c64967d7088461b1ca0a25d3a.zip | |
Fix bytecode register allocation for comparisons.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lj_parse.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lj_parse.c b/src/lj_parse.c index 74dd5706..e18f4bfb 100644 --- a/src/lj_parse.c +++ b/src/lj_parse.c | |||
| @@ -851,9 +851,12 @@ static void bcemit_comp(FuncState *fs, BinOpr opr, ExpDesc *e1, ExpDesc *e2) | |||
| 851 | e1 = e2; e2 = eret; /* Swap operands. */ | 851 | e1 = e2; e2 = eret; /* Swap operands. */ |
| 852 | op = ((op-BC_ISLT)^3)+BC_ISLT; | 852 | op = ((op-BC_ISLT)^3)+BC_ISLT; |
| 853 | expr_toval(fs, e1); | 853 | expr_toval(fs, e1); |
| 854 | ra = expr_toanyreg(fs, e1); | ||
| 855 | rd = expr_toanyreg(fs, e2); | ||
| 856 | } else { | ||
| 857 | rd = expr_toanyreg(fs, e2); | ||
| 858 | ra = expr_toanyreg(fs, e1); | ||
| 854 | } | 859 | } |
| 855 | rd = expr_toanyreg(fs, e2); | ||
| 856 | ra = expr_toanyreg(fs, e1); | ||
| 857 | ins = BCINS_AD(op, ra, rd); | 860 | ins = BCINS_AD(op, ra, rd); |
| 858 | } | 861 | } |
| 859 | /* Using expr_free might cause asserts if the order is wrong. */ | 862 | /* Using expr_free might cause asserts if the order is wrong. */ |
