diff options
Diffstat (limited to '')
-rw-r--r-- | src/lj_opt_sink.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lj_opt_sink.c b/src/lj_opt_sink.c index 937cccc7..b7a3af2d 100644 --- a/src/lj_opt_sink.c +++ b/src/lj_opt_sink.c | |||
@@ -32,8 +32,6 @@ static IRIns *sink_checkalloc(jit_State *J, IRIns *irs) | |||
32 | ir = IR(ir->op1); | 32 | ir = IR(ir->op1); |
33 | if (!(ir->o == IR_TNEW || ir->o == IR_TDUP || ir->o == IR_CNEW)) | 33 | if (!(ir->o == IR_TNEW || ir->o == IR_TDUP || ir->o == IR_CNEW)) |
34 | return NULL; /* Not an allocation. */ | 34 | return NULL; /* Not an allocation. */ |
35 | if (ir + 255 < irs) | ||
36 | return NULL; /* Out of range. */ | ||
37 | return ir; /* Return allocation. */ | 35 | return ir; /* Return allocation. */ |
38 | } | 36 | } |
39 | 37 | ||
@@ -173,10 +171,12 @@ static void sink_sweep_ins(jit_State *J) | |||
173 | switch (ir->o) { | 171 | switch (ir->o) { |
174 | case IR_ASTORE: case IR_HSTORE: case IR_FSTORE: case IR_XSTORE: { | 172 | case IR_ASTORE: case IR_HSTORE: case IR_FSTORE: case IR_XSTORE: { |
175 | IRIns *ira = sink_checkalloc(J, ir); | 173 | IRIns *ira = sink_checkalloc(J, ir); |
176 | if (ira && !irt_ismarked(ira->t)) | 174 | if (ira && !irt_ismarked(ira->t)) { |
177 | ir->prev = REGSP(RID_SINK, (int)(ir - ira)); | 175 | int delta = (int)(ir - ira); |
178 | else | 176 | ir->prev = REGSP(RID_SINK, delta > 255 ? 255 : delta); |
177 | } else { | ||
179 | ir->prev = REGSP_INIT; | 178 | ir->prev = REGSP_INIT; |
179 | } | ||
180 | break; | 180 | break; |
181 | } | 181 | } |
182 | case IR_NEWREF: | 182 | case IR_NEWREF: |