Skip to content

Commit ebd00c5

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Fixed bug #79128
2 parents 98bfad7 + 3291891 commit ebd00c5

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

ext/opcache/ZendAccelerator.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4270,19 +4270,24 @@ static zend_persistent_script* preload_script_in_shared_memory(zend_persistent_s
42704270
static void preload_load(void)
42714271
{
42724272
/* Load into process tables */
4273-
if (zend_hash_num_elements(&ZCSG(preload_script)->script.function_table)) {
4274-
Bucket *p = ZCSG(preload_script)->script.function_table.arData;
4275-
Bucket *end = p + ZCSG(preload_script)->script.function_table.nNumUsed;
4273+
zend_script *script = &ZCSG(preload_script)->script;
4274+
if (zend_hash_num_elements(&script->function_table)) {
4275+
Bucket *p = script->function_table.arData;
4276+
Bucket *end = p + script->function_table.nNumUsed;
42764277

4278+
zend_hash_extend(CG(function_table),
4279+
CG(function_table)->nNumUsed + script->function_table.nNumUsed, 0);
42774280
for (; p != end; p++) {
42784281
_zend_hash_append_ptr_ex(CG(function_table), p->key, Z_PTR(p->val), 1);
42794282
}
42804283
}
42814284

4282-
if (zend_hash_num_elements(&ZCSG(preload_script)->script.class_table)) {
4283-
Bucket *p = ZCSG(preload_script)->script.class_table.arData;
4284-
Bucket *end = p + ZCSG(preload_script)->script.class_table.nNumUsed;
4285+
if (zend_hash_num_elements(&script->class_table)) {
4286+
Bucket *p = script->class_table.arData;
4287+
Bucket *end = p + script->class_table.nNumUsed;
42854288

4289+
zend_hash_extend(CG(class_table),
4290+
CG(class_table)->nNumUsed + script->class_table.nNumUsed, 0);
42864291
for (; p != end; p++) {
42874292
_zend_hash_append_ex(CG(class_table), p->key, &p->val, 1);
42884293
}

0 commit comments

Comments
 (0)