[php-src] PHP-8.6: Merge branch 'PHP-8.4' into PHP-8.5

From: Date: Tue, 27 Oct 2026 19:40:26 +0000
Subject: [php-src] PHP-8.6: Merge branch 'PHP-8.4' into PHP-8.5
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-142848@lists.php.net to get a copy of this message
Author: ndossche (ndossche) Date: 2026-10-27T20:39:54+01:00 Commit: https://github.com/php/php-src/commit/07e5953b275bfa32e06ceb507a4a5d9492672bfa Raw diff: https://github.com/php/php-src/commit/07e5953b275bfa32e06ceb507a4a5d9492672bfa.diff Merge branch 'PHP-8.4' into PHP-8.5 * PHP-8.4: opcache: Call orig_post_shutdown_cb() JIT: Discard veneers if generation failed Changed paths: M NEWS M ext/opcache/ZendAccelerator.c M ext/opcache/jit/zend_jit_ir.c Diff: diff --git a/NEWS b/NEWS index d6d453231178..8799a926a58d 100644 --- a/NEWS +++ b/NEWS @@ -138,6 +138,9 @@ PHP NEWS map_ptr offset). (prateekbhujel) . Fixed tracing JIT losing register-allocated CVs when an interrupt is handled at the end of a loop trace. (Levi Morrison) + . Fixed bug GH-24675 (function with >~1.7 MB of machine code corrupts JIT + buffer accounting). (ndossche) + . Call orig_post_shutdown_cb(). (ndossche) - PDO: . Fixed invalid ATTR_ORACLE_NULLS values being accepted and truncated. diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index f2e7a3fca2a6..b3b7e2332178 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -3500,6 +3500,11 @@ static void (*orig_post_shutdown_cb)(void); static void accel_post_shutdown(void) { + /* Call original shutdown prior to detaching SHM, so it can access its memory safely. */ + if (orig_post_shutdown_cb) { + orig_post_shutdown_cb(); + } + zend_shared_alloc_shutdown(); } diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index 52bd527d9d50..ad67ca594884 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -472,6 +472,15 @@ static void zend_jit_commit_veneers(void) } } } + +static void zend_jit_discard_veneers(void) +{ + int i, count = sizeof(zend_jit_stubs) / sizeof(zend_jit_stubs[0]); + + for (i = 0; i < count; i++) { + zend_jit_stub_handlers[count + i] = NULL; + } +} #endif static bool zend_jit_prefer_const_addr_load(zend_jit_ctx *jit, uintptr_t addr) @@ -2967,7 +2976,11 @@ static void *zend_jit_ir_compile(ir_ctx *ctx, size_t *size, const char *name) #if defined(IR_TARGET_AARCH64) if (ctx->flags2 & IR_HAS_VENEERS) { - zend_jit_commit_veneers(); + if (entry) { + zend_jit_commit_veneers(); + } else { + zend_jit_discard_veneers(); + } } #endif

« previous php.cvs (#142848) next »