Skip to content

Commit 34645ae

Browse files
committed
Don't preload constants defined during preload script excution.
1 parent cef0d67 commit 34645ae

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

ext/opcache/ZendAccelerator.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3764,6 +3764,18 @@ static int accel_preload(const char *config)
37643764
preload_link();
37653765
preload_remove_empty_includes();
37663766

3767+
/* Don't preload constants */
3768+
if (EG(zend_constants)) {
3769+
zval *zv;
3770+
ZEND_HASH_REVERSE_FOREACH_VAL(EG(zend_constants), zv) {
3771+
zend_constant *c = Z_PTR_P(zv);
3772+
if (ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT) {
3773+
break;
3774+
}
3775+
EG(zend_constants)->pDestructor(zv);
3776+
} ZEND_HASH_FOREACH_END_DEL();
3777+
}
3778+
37673779
script = create_persistent_script();
37683780

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

0 commit comments

Comments
 (0)