Skip to content

Commit 14fd6f8

Browse files
committed
Don't set static_variables_ptr if no static_variables
We should only ever set this to a non-null value if there are static_variables. Make sure this is the case in lazy class loading as well.
1 parent 04c4d5a commit 14fd6f8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Zend/zend_inheritance.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2502,7 +2502,9 @@ static zend_class_entry *zend_lazy_class_load(zend_class_entry *pce)
25022502
new_op_array->fn_flags &= ~ZEND_ACC_IMMUTABLE;
25032503
new_op_array->scope = ce;
25042504
ZEND_MAP_PTR_INIT(new_op_array->run_time_cache, run_time_cache_ptr);
2505-
ZEND_MAP_PTR_INIT(new_op_array->static_variables_ptr, static_variables_ptr);
2505+
if (new_op_array->static_variables) {
2506+
ZEND_MAP_PTR_INIT(new_op_array->static_variables_ptr, static_variables_ptr);
2507+
}
25062508

25072509
zend_update_inherited_handler(constructor);
25082510
zend_update_inherited_handler(destructor);

0 commit comments

Comments
 (0)