mirror of
https://github.com/php/php-src.git
synced 2024-09-23 02:47:26 +00:00
Fix persisting property info table with internal parent
If the property info comes from an internal parent, we won't have an xlat entry for it. Leave it alone in that case.
This commit is contained in:
parent
6f2431860b
commit
14c42c6961
@ -51,6 +51,13 @@ class TraitAliasTest {
|
||||
}
|
||||
}
|
||||
|
||||
// Create reference to a property declared in an internal parent class.
|
||||
class MyException extends Exception {
|
||||
public function __construct($message) {
|
||||
$this->message =& $message;
|
||||
}
|
||||
}
|
||||
|
||||
function get_anon() {
|
||||
return new class {};
|
||||
}
|
||||
|
19
ext/opcache/tests/preload_prop_info_table.phpt
Normal file
19
ext/opcache/tests/preload_prop_info_table.phpt
Normal file
@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Preloading of the property info table with internal parent
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.optimization_level=-1
|
||||
opcache.preload={PWD}/preload.inc
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
if (PHP_OS_FAMILY == 'Windows') die('skip Preloading is not supported on Windows');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$e = new MyException("foo");
|
||||
echo $e->getMessage(), "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
foo
|
@ -914,8 +914,11 @@ static void zend_persist_class_entry(zval *zv)
|
||||
|
||||
for (i = 0; i < ce->default_properties_count; i++) {
|
||||
if (ce->properties_info_table[i]) {
|
||||
ce->properties_info_table[i] = zend_shared_alloc_get_xlat_entry(
|
||||
zend_property_info *prop_info = zend_shared_alloc_get_xlat_entry(
|
||||
ce->properties_info_table[i]);
|
||||
if (prop_info) {
|
||||
ce->properties_info_table[i] = prop_info;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user