mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
@@ -15549,9 +15549,13 @@ static int zend_jit_switch(zend_jit_ctx *jit, const zend_op *opline, const zend_
|
||||
ir_MERGE_list(continue_list);
|
||||
} else {
|
||||
if (default_input_list) {
|
||||
ZEND_ASSERT(jit->ctx.ir_base[ref].op == IR_SWITCH);
|
||||
ZEND_ASSERT(jit->ctx.ir_base[ref].op3 == IR_UNUSED);
|
||||
jit->ctx.ir_base[ref].op3 = default_input_list;
|
||||
if (jit->ctx.ir_base[ref].op == IR_SWITCH) {
|
||||
ZEND_ASSERT(jit->ctx.ir_base[ref].op3 == IR_UNUSED);
|
||||
jit->ctx.ir_base[ref].op3 = default_input_list;
|
||||
} else {
|
||||
ir_MERGE_list(default_input_list);
|
||||
_zend_jit_add_predecessor_ref(jit, default_b, jit->b, ir_END());
|
||||
}
|
||||
}
|
||||
jit->b = -1;
|
||||
}
|
||||
|
||||
22
ext/opcache/tests/jit/match_001.phpt
Normal file
22
ext/opcache/tests/jit/match_001.phpt
Normal file
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Match with undefined input
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_update_protection=0
|
||||
opcache.jit_buffer_size=1M
|
||||
--FILE--
|
||||
<?php
|
||||
function foo() {
|
||||
return match($y){1,6=>0};
|
||||
}
|
||||
foo();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Undefined variable $y in %smatch_001.php on line 3
|
||||
|
||||
Fatal error: Uncaught UnhandledMatchError: Unhandled match case NULL in %smatch_001.php:3
|
||||
Stack trace:
|
||||
#0 %smatch_001.php(5): foo()
|
||||
#1 {main}
|
||||
thrown in %smatch_001.php on line 3
|
||||
Reference in New Issue
Block a user