Skip to content

Commit 5e9654b

Browse files
committed
Fixed missing run_time_cache for preloaded arena allocated internal functions
This effectively affected all preloaded enums, leading them to possibly share a run_time_cache__ptr slot with unrelated functions. (Given that these were not set again.) This bugfix is not accompanied by a test, due to how hard to trigger it was and getting a crash also depends a lot on the precise alignment of whether a cache entry accidentally overlapping has been used etc.
1 parent cb3d5a7 commit 5e9654b

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ PHP NEWS
77
evaluation with extra named params). (Arnaud)
88
. Fixed bug GH-9801 (Generator crashes when memory limit is exceeded during
99
initialization). (Arnaud)
10+
. Fixed a bug with preloaded enums possibly segfaulting. (Bob)
1011

1112
- MySQLnd:
1213
. Fixed potential heap corruption due to alignment mismatch. (cmb)

ext/opcache/zend_persist.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,7 @@ static void zend_persist_class_method(zval *zv, zend_class_entry *ce)
723723
}
724724
}
725725
}
726+
ZEND_MAP_PTR_NEW(op_array->run_time_cache);
726727
}
727728
}
728729
return;

0 commit comments

Comments
 (0)