Skip to content

Commit

Permalink
Don't preload constants defined during preload script excution.
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Nov 8, 2018
1 parent cef0d67 commit 34645ae
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ext/opcache/ZendAccelerator.c
Original file line number Diff line number Diff line change
Expand Up @@ -3764,6 +3764,18 @@ static int accel_preload(const char *config)
preload_link();
preload_remove_empty_includes();

/* Don't preload constants */
if (EG(zend_constants)) {
zval *zv;
ZEND_HASH_REVERSE_FOREACH_VAL(EG(zend_constants), zv) {
zend_constant *c = Z_PTR_P(zv);
if (ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT) {
break;
}
EG(zend_constants)->pDestructor(zv);
} ZEND_HASH_FOREACH_END_DEL();
}

script = create_persistent_script();

/* Fill in the ping_auto_globals_mask for the new script. If jit for auto globals is enabled we
Expand Down

0 comments on commit 34645ae

Please sign in to comment.