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 @@ -3582,7 +3582,9 @@ static zend_always_inline int _zend_update_type_info(
3582
3582
tmp = MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF ;
3583
3583
if (opline -> result_type == IS_TMP_VAR ) {
3584
3584
if (opline -> opcode == ZEND_FETCH_R || opline -> opcode == ZEND_FETCH_IS ) {
3585
- tmp |= MAY_BE_RCN ;
3585
+ /* Variable reference counter may be decremented before use */
3586
+ /* See: ext/opcache/tests/jit/fetch_r_001.phpt */
3587
+ tmp |= MAY_BE_RC1 | MAY_BE_RCN ;
3586
3588
} else {
3587
3589
tmp |= MAY_BE_RC1 | MAY_BE_RCN ;
3588
3590
}
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