File tree 2 files changed +19
-1
lines changed
2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -3629,7 +3629,9 @@ static zend_always_inline int _zend_update_type_info(
3629
3629
tmp = MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF ;
3630
3630
if (opline -> result_type == IS_TMP_VAR ) {
3631
3631
if (opline -> opcode == ZEND_FETCH_R || opline -> opcode == ZEND_FETCH_IS ) {
3632
- tmp |= MAY_BE_RCN ;
3632
+ /* Variable reference counter may be decremented before use */
3633
+ /* See: ext/opcache/tests/jit/fetch_r_001.phpt */
3634
+ tmp |= MAY_BE_RC1 | MAY_BE_RCN ;
3633
3635
} else {
3634
3636
tmp |= MAY_BE_RC1 | MAY_BE_RCN ;
3635
3637
}
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ FETCH_R: 001 result reference counter may be decremented befor use
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
+ $ x = [&$ v ];
11
+ $ y = 'x ' ;
12
+ $ $ y == [&$ x [0 ]];
13
+ ?>
14
+ DONE
15
+ --EXPECT--
16
+ DONE
You can’t perform that action at this time.
0 commit comments