From 5885b9490c85a99bf700e0fa35207edc7f995cdd Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Fri, 7 Mar 2025 02:30:30 +0300 Subject: [PATCH] Fix function JIT for Wordpress unit tests --- ext/opcache/jit/zend_jit_ir.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index b7841fd1701..32d632f5b96 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -3558,6 +3558,8 @@ static void jit_IF_TRUE_FALSE_ex(zend_jit_ctx *jit, ir_ref if_ref, ir_ref true_b } } +static void zend_jit_case_start(zend_jit_ctx *jit, int switch_b, int case_b, ir_ref switch_ref); + static void _zend_jit_add_predecessor_ref(zend_jit_ctx *jit, int b, int pred, ir_ref ref) { int i, *p; @@ -3580,6 +3582,9 @@ static void _zend_jit_add_predecessor_ref(zend_jit_ctx *jit, int b, int pred, ir } else if (jit->ctx.ir_base[ref].op == IR_IF) { jit_IF_TRUE_FALSE_ex(jit, ref, b); ref = ir_LOOP_END(); + } else if (jit->ctx.ir_base[ref].op == IR_SWITCH) { + zend_jit_case_start(jit, pred, b, ref); + ref = ir_LOOP_END(); } else if (jit->ctx.ir_base[ref].op == IR_UNREACHABLE) { ir_BEGIN(ref); ref = ir_LOOP_END();