File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ PHP NEWS
24
24
- Opcache:
25
25
. Fixed bug GH-18639 (Internal class aliases can break preloading + JIT).
26
26
(nielsdos)
27
+ . Fixed bug GH-18899 (JIT function crash when emitting undefined variable
28
+ warning and opline is not set yet). (nielsdos)
27
29
28
30
- Standard:
29
31
. Fix misleading errors in printf(). (nielsdos)
Original file line number Diff line number Diff line change @@ -5981,6 +5981,7 @@ static int zend_jit_long_math_helper(zend_jit_ctx *jit,
5981
5981
ir_IF_FALSE_cold(if_def);
5982
5982
5983
5983
// zend_error_unchecked(E_WARNING, "Undefined variable $%S", CV_DEF_OF(EX_VAR_TO_NUM(opline->op1.var)));
5984
+ jit_SET_EX_OPLINE(jit, opline);
5984
5985
ir_CALL_1(IR_VOID, ir_CONST_FC_FUNC(zend_jit_undefined_op_helper), ir_CONST_U32(opline->op1.var));
5985
5986
5986
5987
ref2 = jit_EG(uninitialized_zval);
@@ -5997,6 +5998,7 @@ static int zend_jit_long_math_helper(zend_jit_ctx *jit,
5997
5998
ir_IF_FALSE_cold(if_def);
5998
5999
5999
6000
// zend_error_unchecked(E_WARNING, "Undefined variable $%S", CV_DEF_OF(EX_VAR_TO_NUM(opline->op2.var)));
6001
+ jit_SET_EX_OPLINE(jit, opline);
6000
6002
ir_CALL_1(IR_VOID, ir_CONST_FC_FUNC(zend_jit_undefined_op_helper), ir_CONST_U32(opline->op2.var));
6001
6003
6002
6004
ref2 = jit_EG(uninitialized_zval);
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ GH-18899 (JIT function crash when emitting undefined variable warning and opline is not set yet)
3
+ --EXTENSIONS--
4
+ opcache
5
+ --INI--
6
+ opcache.enable=1
7
+ opcache.enable_cli=1
8
+ opcache.jit=1205
9
+ opcache.jit_buffer_size=8M
10
+ --FILE--
11
+ <?php
12
+ function ptr2str ()
13
+ {
14
+ for ($ i =0 ; $ i <8 ; $ i ++) {
15
+ $ ptr >>= 8 ;
16
+ }
17
+ }
18
+ str_repeat ("A " ,232 ).ptr2str ();
19
+ ?>
20
+ --EXPECTF--
21
+ Warning: Undefined variable $ptr in %s on line %d
You can’t perform that action at this time.
0 commit comments