File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -3311,6 +3311,20 @@ static zend_always_inline int _zend_update_type_info(
3311
3311
if (opline -> opcode == ZEND_FETCH_DIM_IS && (t1 & MAY_BE_STRING )) {
3312
3312
tmp |= MAY_BE_NULL ;
3313
3313
}
3314
+ if ((tmp & (MAY_BE_RC1 |MAY_BE_RCN )) == MAY_BE_RCN && opline -> result_type == IS_TMP_VAR ) {
3315
+ /* refcount may be indirectly decremented. Make an exception if the result is used in the next instruction */
3316
+ if (!ssa_opcodes ) {
3317
+ if (ssa -> vars [ssa_op -> result_def ].use_chain < 0
3318
+ || opline + 1 != op_array -> opcodes + ssa -> vars [ssa_op -> result_def ].use_chain ) {
3319
+ tmp |= MAY_BE_RC1 ;
3320
+ }
3321
+ } else {
3322
+ if (ssa -> vars [ssa_op -> result_def ].use_chain < 0
3323
+ || opline + 1 != ssa_opcodes [ssa -> vars [ssa_op -> result_def ].use_chain ]) {
3324
+ tmp |= MAY_BE_RC1 ;
3325
+ }
3326
+ }
3327
+ }
3314
3328
UPDATE_SSA_TYPE (tmp , ssa_op -> result_def );
3315
3329
break ;
3316
3330
case ZEND_FETCH_THIS :
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ JIT FETCH_DIM_R: 013
3
+ --INI--
4
+ opcache.enable=1
5
+ opcache.enable_cli=1
6
+ opcache.file_update_protection=0
7
+ opcache.jit_buffer_size=1M
8
+ --FILE--
9
+ <?php
10
+ function foo () {
11
+ $ y = 0 ; $ tokens = [];
12
+ for ($ cnt = 0 ; $ cnt < 6 ; $ cnt ++) {
13
+ $ tokens [$ y ] > $ tokens [$ y ][] = $ y ;
14
+ }
15
+ }
16
+ @foo ();
17
+ ?>
18
+ DONE
19
+ --EXPECT--
20
+ DONE
You can’t perform that action at this time.
0 commit comments