[php-src] PHP-8.6: Merge branch 'PHP-8.5' into PHP-8.6
| From: | Ilia Alshanetsky | Date: | Mon, 09 Nov 2026 15:22:12 +0000 |
| Subject: | [php-src] PHP-8.6: Merge branch 'PHP-8.5' into PHP-8.6 | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-143485@lists.php.net to get a copy of this message | ||
Author: Ilia Alshanetsky (iliaal)
Date: 2026-11-09T10:08:56-05:00
Commit: https://github.com/php/php-src/commit/e503d47109bdd6af8349c503042d49ed7df00d2b
Raw diff: https://github.com/php/php-src/commit/e503d47109bdd6af8349c503042d49ed7df00d2b.diff
Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
ext/opcache: Fix JIT code emitted past the buffer end on 32-bit
Changed paths:
M ext/opcache/jit/ir/ir_aarch64.dasc
M ext/opcache/jit/ir/ir_x86.dasc
Diff:
diff --git a/ext/opcache/jit/ir/ir_aarch64.dasc b/ext/opcache/jit/ir/ir_aarch64.dasc
index 2269b279284d..2bd57ad7c9d5 100644
--- a/ext/opcache/jit/ir/ir_aarch64.dasc
+++ b/ext/opcache/jit/ir/ir_aarch64.dasc
@@ -9636,7 +9636,7 @@ void *ir_emit_code(ir_ctx *ctx, size_t *size_ptr)
if (ctx->code_buffer) {
entry = ctx->code_buffer->pos;
entry = (void*)IR_ALIGNED_SIZE(((size_t)(entry)), 16);
- if (size > (size_t)((char*)ctx->code_buffer->end - (char*)entry)) {
+ if ((char*)entry > (char*)ctx->code_buffer->end || size >
(size_t)((char*)ctx->code_buffer->end - (char*)entry)) {
dasm_free(&data.dasm_state);
ctx->data = NULL;
ctx->status = IR_ERROR_CODE_MEM_OVERFLOW;
@@ -9779,7 +9779,7 @@ const void *ir_emit_exitgroup(uint32_t first_exit_point, uint32_t
exit_points_pe
entry = code_buffer->pos;
entry = (void*)IR_ALIGNED_SIZE(((size_t)(entry)), 16);
- if (size > (size_t)((char*)code_buffer->end - (char*)entry)) {
+ if ((char*)entry > (char*)code_buffer->end || size > (size_t)((char*)code_buffer->end
- (char*)entry)) {
dasm_free(&dasm_state);
return NULL;
}
@@ -9949,7 +9949,7 @@ void *ir_emit_thunk(ir_code_buffer *code_buffer, void *addr, size_t *size_ptr)
entry = code_buffer->pos;
entry = (void*)IR_ALIGNED_SIZE(((size_t)(entry)), 4);
- if (size > (size_t)((char*)code_buffer->end - (char*)entry)) {
+ if ((char*)entry > (char*)code_buffer->end || size > (size_t)((char*)code_buffer->end
- (char*)entry)) {
*size_ptr = size;
dasm_free(&dasm_state);
return NULL;
diff --git a/ext/opcache/jit/ir/ir_x86.dasc b/ext/opcache/jit/ir/ir_x86.dasc
index 323203899606..9c69cf4d459e 100644
--- a/ext/opcache/jit/ir/ir_x86.dasc
+++ b/ext/opcache/jit/ir/ir_x86.dasc
@@ -26930,7 +26930,7 @@ next_block:;
if (ctx->code_buffer) {
entry = ctx->code_buffer->pos;
entry = (void*)IR_ALIGNED_SIZE(((size_t)(entry)), required_alignment);
- if (size > (size_t)((char*)ctx->code_buffer->end - (char*)entry)) {
+ if ((char*)entry > (char*)ctx->code_buffer->end || size >
(size_t)((char*)ctx->code_buffer->end - (char*)entry)) {
dasm_free(&data.dasm_state);
ctx->data = NULL;
ctx->status = IR_ERROR_CODE_MEM_OVERFLOW;
@@ -27070,7 +27070,7 @@ const void *ir_emit_exitgroup(uint32_t first_exit_point, uint32_t
exit_points_pe
entry = code_buffer->pos;
entry = (void*)IR_ALIGNED_SIZE(((size_t)(entry)), 16);
- if (size > (size_t)((char*)code_buffer->end - (char*)entry)) {
+ if ((char*)entry > (char*)code_buffer->end || size > (size_t)((char*)code_buffer->end
- (char*)entry)) {
dasm_free(&dasm_state);
return NULL;
}