1
0
mirror of https://github.com/php/php-src.git synced 2026-04-12 02:23:18 +02:00

Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #80634 (write_property handler of internal classes is skipped on preloaded JITted code)
This commit is contained in:
Dmitry Stogov
2021-01-20 11:04:30 +03:00
3 changed files with 36 additions and 1 deletions

View File

@@ -12607,7 +12607,10 @@ static zend_property_info* zend_get_known_property_info(zend_class_entry *ce, ze
{
zend_property_info *info = NULL;
if (!ce || !(ce->ce_flags & ZEND_ACC_LINKED) || (ce->ce_flags & ZEND_ACC_TRAIT)) {
if (!ce ||
!(ce->ce_flags & ZEND_ACC_LINKED) ||
(ce->ce_flags & ZEND_ACC_TRAIT) ||
ce->create_object) {
return NULL;
}

View File

@@ -0,0 +1,22 @@
--TEST--
Bug #80634 (write_property handler of internal classes is skipped on preloaded JITted code)
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=1M
opcache.protect_memory=1
opcache.jit=function
opcache.preload={PWD}/preload_bug80634.inc
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$v = new SomeClass(5);
?>
--EXPECTF--
Fatal error: Uncaught Error: Writing to DatePeriod->interval is unsupported in %spreload_bug80634.inc:7
Stack trace:
#0 %sbug80634.php(2): SomeClass->__construct(5)
#1 {main}
thrown in %spreload_bug80634.inc on line 7

View File

@@ -0,0 +1,10 @@
<?php
class SomeClass extends \DatePeriod {
public $interval;
public function __construct(int $v) {
parent::__construct(new \DateTime('2020-12-31'), new \DateInterval("P1Y"), 1);
$this->interval = $v;
var_dump($this->interval);
}
}