Skip to content

Fix GH-10635: ARM64 function JIT causes impossible assertion #10638

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ext/opcache/jit/zend_jit_arm64.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -7722,7 +7722,6 @@ static int zend_jit_identical(dasm_State **Dst,
}
op1_addr = real_addr;
}
| LOAD_ZVAL_ADDR FCARG1x, op1_addr
}
if (opline->op2_type != IS_CONST) {
if (Z_MODE(op2_addr) == IS_REG) {
Expand All @@ -7734,6 +7733,9 @@ static int zend_jit_identical(dasm_State **Dst,
}
| LOAD_ZVAL_ADDR FCARG2x, op2_addr
}
if (opline->op1_type != IS_CONST) {
| LOAD_ZVAL_ADDR FCARG1x, op1_addr
}
}

if ((op1_info & op2_info & MAY_BE_ANY) == 0) {
Expand Down
4 changes: 3 additions & 1 deletion ext/opcache/jit/zend_jit_x86.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -8309,7 +8309,6 @@ static int zend_jit_identical(dasm_State **Dst,
}
op1_addr = real_addr;
}
| LOAD_ZVAL_ADDR FCARG1a, op1_addr
}
if (opline->op2_type != IS_CONST) {
if (Z_MODE(op2_addr) == IS_REG) {
Expand All @@ -8321,6 +8320,9 @@ static int zend_jit_identical(dasm_State **Dst,
}
| LOAD_ZVAL_ADDR FCARG2a, op2_addr
}
if (opline->op1_type != IS_CONST) {
| LOAD_ZVAL_ADDR FCARG1a, op1_addr
}
}

if ((op1_info & op2_info & MAY_BE_ANY) == 0) {
Expand Down
19 changes: 19 additions & 0 deletions ext/opcache/tests/jit/identical_003.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--TEST--
JIT IDENTICAL: 003 register allocation
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=1M
opcache.protect_memory=1
--EXTENSIONS--
opcache
--FILE--
<?php
function foo(array $a, int|float $n) {
var_dump(count($a) === $n);
}
foo([1], 1);
?>
--EXPECT--
bool(true)