Skip to content

Commit d339e5f

Browse files
committed
Merge branch 'PHP-8.1'
* PHP-8.1: Preloading: don't remove INCLUDE_OE_EVAL nstructions with used result
2 parents 1959bbf + 1a6863c commit d339e5f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ext/opcache/ZendAccelerator.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4079,7 +4079,8 @@ static void preload_remove_empty_includes(void)
40794079
if (opline->opcode == ZEND_INCLUDE_OR_EVAL &&
40804080
opline->extended_value != ZEND_EVAL &&
40814081
opline->op1_type == IS_CONST &&
4082-
Z_TYPE_P(RT_CONSTANT(opline, opline->op1)) == IS_STRING) {
4082+
Z_TYPE_P(RT_CONSTANT(opline, opline->op1)) == IS_STRING &&
4083+
opline->result_type == IS_UNUSED) {
40834084

40844085
zend_string *resolved_path = preload_resolve_path(Z_STR_P(RT_CONSTANT(opline, opline->op1)));
40854086

@@ -4125,7 +4126,7 @@ static void preload_remove_empty_includes(void)
41254126

41264127
if (resolved_path) {
41274128
zend_persistent_script *incl = zend_hash_find_ptr(preload_scripts, resolved_path);
4128-
if (incl && incl->empty) {
4129+
if (incl && incl->empty && opline->result_type == IS_UNUSED) {
41294130
MAKE_NOP(opline);
41304131
} else {
41314132
if (!IS_ABSOLUTE_PATH(Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), Z_STRLEN_P(RT_CONSTANT(opline, opline->op1)))) {

0 commit comments

Comments
 (0)