Skip to content

Commit 0a24cd4

Browse files
committed
Preloading: Fix handling of static vars in inherited methods
Part of bug #78512.
1 parent 5f555fb commit 0a24cd4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

ext/opcache/ZendAccelerator.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4290,8 +4290,9 @@ static int accel_preload(const char *config)
42904290
if (op_array->static_variables) {
42914291
HashTable *ht = ZEND_MAP_PTR_GET(op_array->static_variables_ptr);
42924292
if (ht) {
4293-
ZEND_ASSERT(GC_REFCOUNT(ht) == 1);
4294-
zend_array_destroy(ht);
4293+
if (GC_DELREF(ht) == 0) {
4294+
zend_array_destroy(ht);
4295+
}
42954296
ZEND_MAP_PTR_SET(op_array->static_variables_ptr, NULL);
42964297
}
42974298
}

ext/opcache/tests/preload_bug78175_2.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ class Loader {
1515
}
1616
}
1717

18+
class ExtLoader extends Loader {
19+
}
20+
1821
Loader::getLoader();
1922
Loader::getCounter();
2023
Loader::getCounter();

0 commit comments

Comments
 (0)