Skip to content

Commit cd8e6f5

Browse files
committed
Preloading: don't remove INCLUDE_OE_EVAL nstructions with used result
1 parent c787f42 commit cd8e6f5

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
@@ -4075,7 +4075,8 @@ static void preload_remove_empty_includes(void)
40754075
if (opline->opcode == ZEND_INCLUDE_OR_EVAL &&
40764076
opline->extended_value != ZEND_EVAL &&
40774077
opline->op1_type == IS_CONST &&
4078-
Z_TYPE_P(RT_CONSTANT(opline, opline->op1)) == IS_STRING) {
4078+
Z_TYPE_P(RT_CONSTANT(opline, opline->op1)) == IS_STRING &&
4079+
opline->result_type == IS_UNUSED) {
40794080

40804081
zend_string *resolved_path = preload_resolve_path(Z_STR_P(RT_CONSTANT(opline, opline->op1)));
40814082

@@ -4121,7 +4122,7 @@ static void preload_remove_empty_includes(void)
41214122

41224123
if (resolved_path) {
41234124
zend_persistent_script *incl = zend_hash_find_ptr(preload_scripts, resolved_path);
4124-
if (incl && incl->empty) {
4125+
if (incl && incl->empty && opline->result_type == IS_UNUSED) {
41254126
MAKE_NOP(opline);
41264127
} else {
41274128
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)