summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2015-01-05 23:39:37 +0100
committerMike Pall <mike>2015-01-05 23:39:37 +0100
commit999f57de83180c4edd928eb9051e58602ba7e20a (patch)
tree3a5b1834e88f22072e7532eb37b1dce3cb264249
parent4d9e8e245a96b2ef30c9ec34ab1c98bca3dcccb8 (diff)
downloadluajit2-999f57de83180c4edd928eb9051e58602ba7e20a.tar.gz
Fix BC_UCLO/BC_JMP join optimization in Lua parser.
-rw-r--r--src/lj_parse.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lj_parse.c b/src/lj_parse.c
index e8aafba2..5ced1dd8 100644
--- a/src/lj_parse.c
+++ b/src/lj_parse.c
@@ -685,10 +685,12 @@ static BCPos bcemit_jmp(FuncState *fs)
BCPos j = fs->pc - 1;
BCIns *ip = &fs->bcbase[j].ins;
fs->jpc = NO_JMP;
- if ((int32_t)j >= (int32_t)fs->lasttarget && bc_op(*ip) == BC_UCLO)
+ if ((int32_t)j >= (int32_t)fs->lasttarget && bc_op(*ip) == BC_UCLO) {
setbc_j(ip, NO_JMP);
- else
+ fs->lasttarget = j+1;
+ } else {
j = bcemit_AJ(fs, BC_JMP, fs->freereg, NO_JMP);
+ }
jmp_append(fs, &j, jpc);
return j;
}