Skip to content

Commit 37f495c

Browse files
committed
opcache: Call orig_post_shutdown_cb()
This was never called and resulted in this compiler warning: ``` ./ext/opcache/ZendAccelerator.c:3720:15: warning: variable 'orig_post_shutdown_cb' set but not used [-Wunused-but-set-global] 3720 | static void (*orig_post_shutdown_cb)(void); | ^ ``` Closes GH-24761.
1 parent 11bea59 commit 37f495c

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

‎NEWS‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ PHP NEWS
157157
handled at the end of a loop trace. (Levi Morrison)
158158
. Fixed bug GH-24675 (function with >~1.7 MB of machine code corrupts JIT
159159
buffer accounting). (ndossche)
160+
. Call orig_post_shutdown_cb(). (ndossche)
160161

161162
- PDO:
162163
. Fixed invalid ATTR_ORACLE_NULLS values being accepted and truncated.

‎ext/opcache/ZendAccelerator.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3429,6 +3429,11 @@ static void (*orig_post_shutdown_cb)(void);
34293429

34303430
static void accel_post_shutdown(void)
34313431
{
3432+
/* Call original shutdown prior to detaching SHM, so it can access its memory safely. */
3433+
if (orig_post_shutdown_cb) {
3434+
orig_post_shutdown_cb();
3435+
}
3436+
34323437
zend_shared_alloc_shutdown();
34333438
}
34343439

0 commit comments

Comments
 (0)