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
2424- Opcache:
2525 . Fixed bug GH-18639 (Internal class aliases can break preloading + JIT).
2626 (nielsdos)
27+ . Fixed bug GH-18899 (JIT function crash when emitting undefined variable
28+ warning and opline is not set yet). (nielsdos)
2729
2830- Standard:
2931 . 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,
59815981 ir_IF_FALSE_cold(if_def);
59825982
59835983 // 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);
59845985 ir_CALL_1(IR_VOID, ir_CONST_FC_FUNC(zend_jit_undefined_op_helper), ir_CONST_U32(opline->op1.var));
59855986
59865987 ref2 = jit_EG(uninitialized_zval);
@@ -5997,6 +5998,7 @@ static int zend_jit_long_math_helper(zend_jit_ctx *jit,
59975998 ir_IF_FALSE_cold(if_def);
59985999
59996000 // 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);
60006002 ir_CALL_1(IR_VOID, ir_CONST_FC_FUNC(zend_jit_undefined_op_helper), ir_CONST_U32(opline->op2.var));
60016003
60026004 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