mirror of
https://github.com/php/php-src.git
synced 2024-12-16 05:15:03 +08:00
Merge branch 'PHP-8.3'
* PHP-8.3: Fixed GH-12262: Tracing JIT assertion crash when using phpstan
This commit is contained in:
commit
a01e0aa590
@ -2191,7 +2191,7 @@ static const zend_property_info *zend_fetch_prop_info(const zend_op_array *op_ar
|
||||
if (opline->op2_type == IS_CONST) {
|
||||
const zend_class_entry *ce = NULL;
|
||||
|
||||
if (opline->op1_type == IS_UNUSED) {
|
||||
if (opline->op1_type == IS_UNUSED && !(op_array->fn_flags & ZEND_ACC_TRAIT_CLONE)) {
|
||||
ce = op_array->scope;
|
||||
} else if (ssa_op->op1_use >= 0) {
|
||||
ce = ssa->var_info[ssa_op->op1_use].ce;
|
||||
|
43
ext/opcache/tests/jit/gh12262.phpt
Normal file
43
ext/opcache/tests/jit/gh12262.phpt
Normal file
@ -0,0 +1,43 @@
|
||||
--TEST--
|
||||
GH-12262: Tracing JIT assertion crash when using phpstan
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_update_protection=0
|
||||
opcache.jit_hot_func=2
|
||||
--FILE--
|
||||
<?php
|
||||
class C {
|
||||
}
|
||||
trait T {
|
||||
public function equal(C $type): bool {
|
||||
return $type instanceof self && $this->value === $type->value;
|
||||
}
|
||||
}
|
||||
class C1 extends C {
|
||||
use T;
|
||||
public function __construct(private int $value) {
|
||||
}
|
||||
}
|
||||
class C2 extends C {
|
||||
use T;
|
||||
public function __construct(private string $value) {
|
||||
}
|
||||
}
|
||||
$x = new C1(1);
|
||||
var_dump($x->equal($x));
|
||||
var_dump($x->equal($x));
|
||||
var_dump($x->equal($x));
|
||||
|
||||
$a = new C2("aaa");
|
||||
var_dump($a->equal($a));
|
||||
var_dump($a->equal($a));
|
||||
var_dump($a->equal($a));
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
Loading…
Reference in New Issue
Block a user