Skip to content

Commit

Permalink
Preloading: don't remove INCLUDE_OE_EVAL nstructions with used result
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Dec 14, 2021
1 parent c787f42 commit cd8e6f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ext/opcache/ZendAccelerator.c
Expand Up @@ -4075,7 +4075,8 @@ static void preload_remove_empty_includes(void)
if (opline->opcode == ZEND_INCLUDE_OR_EVAL &&
opline->extended_value != ZEND_EVAL &&
opline->op1_type == IS_CONST &&
Z_TYPE_P(RT_CONSTANT(opline, opline->op1)) == IS_STRING) {
Z_TYPE_P(RT_CONSTANT(opline, opline->op1)) == IS_STRING &&
opline->result_type == IS_UNUSED) {

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

Expand Down Expand Up @@ -4121,7 +4122,7 @@ static void preload_remove_empty_includes(void)

if (resolved_path) {
zend_persistent_script *incl = zend_hash_find_ptr(preload_scripts, resolved_path);
if (incl && incl->empty) {
if (incl && incl->empty && opline->result_type == IS_UNUSED) {
MAKE_NOP(opline);
} else {
if (!IS_ABSOLUTE_PATH(Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), Z_STRLEN_P(RT_CONSTANT(opline, opline->op1)))) {
Expand Down

0 comments on commit cd8e6f5

Please sign in to comment.