Skip to content

Commit 1a6863c

Browse files
committed
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: Preloading: don't remove INCLUDE_OE_EVAL nstructions with used result
2 parents 1e56b64 + cd8e6f5 commit 1a6863c

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
@@ -4086,7 +4086,8 @@ static void preload_remove_empty_includes(void)
40864086
if (opline->opcode == ZEND_INCLUDE_OR_EVAL &&
40874087
opline->extended_value != ZEND_EVAL &&
40884088
opline->op1_type == IS_CONST &&
4089-
Z_TYPE_P(RT_CONSTANT(opline, opline->op1)) == IS_STRING) {
4089+
Z_TYPE_P(RT_CONSTANT(opline, opline->op1)) == IS_STRING &&
4090+
opline->result_type == IS_UNUSED) {
40904091

40914092
zend_string *resolved_path = preload_resolve_path(Z_STR_P(RT_CONSTANT(opline, opline->op1)));
40924093

@@ -4132,7 +4133,7 @@ static void preload_remove_empty_includes(void)
41324133

41334134
if (resolved_path) {
41344135
zend_persistent_script *incl = zend_hash_find_ptr(preload_scripts, resolved_path);
4135-
if (incl && incl->empty) {
4136+
if (incl && incl->empty && opline->result_type == IS_UNUSED) {
41364137
MAKE_NOP(opline);
41374138
} else {
41384139
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)