mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: Fix incorrect handling of ZEND_ACC_FINAL flag in JIT (#16778)
This commit is contained in:
@@ -1751,7 +1751,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
|
||||
ce = op_array->scope;
|
||||
/* scope is NULL for closures. */
|
||||
if (ce) {
|
||||
ce_is_instanceof = (ce->ce_flags & ZEND_ACC_FINAL) != 0;
|
||||
ce_is_instanceof = !(ce->ce_flags & ZEND_ACC_FINAL);
|
||||
}
|
||||
op1_addr = 0;
|
||||
on_this = 1;
|
||||
@@ -1802,7 +1802,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
|
||||
ce = op_array->scope;
|
||||
/* scope is NULL for closures. */
|
||||
if (ce) {
|
||||
ce_is_instanceof = (ce->ce_flags & ZEND_ACC_FINAL) != 0;
|
||||
ce_is_instanceof = !(ce->ce_flags & ZEND_ACC_FINAL);
|
||||
}
|
||||
op1_addr = 0;
|
||||
on_this = 1;
|
||||
@@ -1846,7 +1846,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
|
||||
ce = op_array->scope;
|
||||
/* scope is NULL for closures. */
|
||||
if (ce) {
|
||||
ce_is_instanceof = (ce->ce_flags & ZEND_ACC_FINAL) != 0;
|
||||
ce_is_instanceof = !(ce->ce_flags & ZEND_ACC_FINAL);
|
||||
}
|
||||
op1_addr = 0;
|
||||
on_this = 1;
|
||||
@@ -2324,7 +2324,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
|
||||
ce = op_array->scope;
|
||||
/* scope is NULL for closures. */
|
||||
if (ce) {
|
||||
ce_is_instanceof = (ce->ce_flags & ZEND_ACC_FINAL) != 0;
|
||||
ce_is_instanceof = !(ce->ce_flags & ZEND_ACC_FINAL);
|
||||
}
|
||||
on_this = 1;
|
||||
} else {
|
||||
@@ -2478,7 +2478,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
|
||||
ce = op_array->scope;
|
||||
/* scope is NULL for closures. */
|
||||
if (ce) {
|
||||
ce_is_instanceof = (ce->ce_flags & ZEND_ACC_FINAL) != 0;
|
||||
ce_is_instanceof = !(ce->ce_flags & ZEND_ACC_FINAL);
|
||||
}
|
||||
on_this = 1;
|
||||
} else {
|
||||
|
||||
@@ -4754,7 +4754,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
|
||||
ce = op_array->scope;
|
||||
/* scope is NULL for closures. */
|
||||
if (ce) {
|
||||
ce_is_instanceof = (ce->ce_flags & ZEND_ACC_FINAL) != 0;
|
||||
ce_is_instanceof = !(ce->ce_flags & ZEND_ACC_FINAL);
|
||||
}
|
||||
op1_addr = 0;
|
||||
on_this = 1;
|
||||
@@ -4848,7 +4848,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
|
||||
ce = op_array->scope;
|
||||
/* scope is NULL for closures. */
|
||||
if (ce) {
|
||||
ce_is_instanceof = (ce->ce_flags & ZEND_ACC_FINAL) != 0;
|
||||
ce_is_instanceof = !(ce->ce_flags & ZEND_ACC_FINAL);
|
||||
}
|
||||
op1_addr = 0;
|
||||
on_this = 1;
|
||||
@@ -4931,7 +4931,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
|
||||
ce = op_array->scope;
|
||||
/* scope is NULL for closures. */
|
||||
if (ce) {
|
||||
ce_is_instanceof = (ce->ce_flags & ZEND_ACC_FINAL) != 0;
|
||||
ce_is_instanceof = !(ce->ce_flags & ZEND_ACC_FINAL);
|
||||
}
|
||||
op1_addr = 0;
|
||||
on_this = 1;
|
||||
@@ -6002,7 +6002,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
|
||||
ce = op_array->scope;
|
||||
/* scope is NULL for closures. */
|
||||
if (ce) {
|
||||
ce_is_instanceof = (ce->ce_flags & ZEND_ACC_FINAL) != 0;
|
||||
ce_is_instanceof = !(ce->ce_flags & ZEND_ACC_FINAL);
|
||||
}
|
||||
op1_addr = 0;
|
||||
on_this = 1;
|
||||
@@ -6285,7 +6285,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
|
||||
ce = op_array->scope;
|
||||
/* scope is NULL for closures. */
|
||||
if (ce) {
|
||||
ce_is_instanceof = (ce->ce_flags & ZEND_ACC_FINAL) != 0;
|
||||
ce_is_instanceof = !(ce->ce_flags & ZEND_ACC_FINAL);
|
||||
}
|
||||
op1_addr = 0;
|
||||
on_this = 1;
|
||||
|
||||
38
ext/opcache/tests/jit/assign_obj_005.phpt
Normal file
38
ext/opcache/tests/jit/assign_obj_005.phpt
Normal file
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
JIT ASSIGN_OBJ: Typed & not-typed property
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_update_protection=0
|
||||
opcache.jit_buffer_size=1M
|
||||
--FILE--
|
||||
<?php
|
||||
interface I {
|
||||
}
|
||||
abstract class C1 implements I {
|
||||
public function __construct($x) {
|
||||
$this->x = $x;
|
||||
}
|
||||
}
|
||||
class C2 extends C1 {
|
||||
public $x = 0;
|
||||
}
|
||||
class C3 extends C1 {
|
||||
public int $x = 0;
|
||||
}
|
||||
$o = new C2("abcd");
|
||||
var_dump($o->x);
|
||||
$o = new C3(42);
|
||||
var_dump($o->x);
|
||||
$o = new C3("abcd");
|
||||
var_dump($o->x);
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(4) "abcd"
|
||||
int(42)
|
||||
|
||||
Fatal error: Uncaught TypeError: Cannot assign string to property C3::$x of type int in %sassign_obj_005.php:6
|
||||
Stack trace:
|
||||
#0 %sassign_obj_005.php(19): C1->__construct('abcd')
|
||||
#1 {main}
|
||||
thrown in %sassign_obj_005.php on line 6
|
||||
Reference in New Issue
Block a user