From 4dfff03b3c8aa7c1d50cd44f6f2646bc4d40b160 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 14 Sep 2023 20:22:25 +0300 Subject: [PATCH] Improve error handling --- ext/opcache/config.m4 | 2 +- ext/opcache/config.w32 | 2 +- ext/opcache/jit/ir | 2 +- ext/opcache/jit/zend_jit_ir.c | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4 index 83f13b739506b..0e0190ab14272 100644 --- a/ext/opcache/config.m4 +++ b/ext/opcache/config.m4 @@ -147,7 +147,7 @@ if test "$PHP_OPCACHE" != "no"; then JIT_CFLAGS="-I@ext_builddir@/jit/ir -D${IR_TARGET} -DIR_PHP" if test "$ZEND_DEBUG" = "yes"; then - JIT_CFLAGS="${JIT_CFLAGS} -DIR_DEBUG -DIR_DEBUG_MESSAGES" + JIT_CFLAGS="${JIT_CFLAGS} -DIR_DEBUG" fi fi diff --git a/ext/opcache/config.w32 b/ext/opcache/config.w32 index cc3b256dee22d..da60492b59f7e 100644 --- a/ext/opcache/config.w32 +++ b/ext/opcache/config.w32 @@ -55,7 +55,7 @@ if (PHP_OPCACHE != "no") { ADD_FLAG("CFLAGS_OPCACHE", "/I \"ext\\opcache\\jit\\ir\" /D "+ir_target+" /D IR_PHP"); if (PHP_DEBUG == "yes") { - ADD_FLAG("CFLAGS_OPCACHE", "/D IR_DEBUG /D IR_DEBUG_MESSAGES"); + ADD_FLAG("CFLAGS_OPCACHE", "/D IR_DEBUG"); } if (CHECK_HEADER_ADD_INCLUDE("capstone\\capstone.h", "CFLAGS_OPCACHE", PHP_OPCACHE+ ";" + PHP_PHP_BUILD + "\\include") && diff --git a/ext/opcache/jit/ir b/ext/opcache/jit/ir index aeaa6404b7f04..8977307f4e96e 160000 --- a/ext/opcache/jit/ir +++ b/ext/opcache/jit/ir @@ -1 +1 @@ -Subproject commit aeaa6404b7f04e12717354002b8cb2f2c14c38ef +Subproject commit 8977307f4e96ee03847d7f2eb809b3080f9ed662 diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index 33c31d2130d8b..dea1e74de9492 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -648,7 +648,8 @@ uint32_t zend_jit_duplicate_exit_point(ir_ctx *ctx, zend_jit_trace_info *t, uint uint32_t new_exit_point = t->exit_count; if (new_exit_point >= ZEND_JIT_TRACE_MAX_EXITS) { - ZEND_ASSERT(0 && "ZEND_JIT_TRACE_MAX_EXITS"); + ctx->status = -ZEND_JIT_TRACE_STOP_TOO_MANY_EXITS; + return exit_point; } t->exit_count++;