mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fixed bug #76337
This commit is contained in:
parent
a8a1dc038c
commit
5681f6523b
3 changed files with 15 additions and 0 deletions
12
Zend/tests/bug76337.phpt
Normal file
12
Zend/tests/bug76337.phpt
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
--TEST--
|
||||||
|
Bug 76337: segmentation fault when an extension use zend_register_class_alias() and opcache enabled
|
||||||
|
--SKIPIF--
|
||||||
|
<?php if (!class_exists('_ZendTestClass') || !extension_loaded('Zend OPcache')) die('skip');
|
||||||
|
--INI--
|
||||||
|
opcache.enable=1
|
||||||
|
opcache.enable_cli=1
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
var_dump(class_exists('_ZendTestClassAlias'));
|
||||||
|
--EXPECT--
|
||||||
|
bool(true)
|
|
@ -2785,6 +2785,7 @@ ZEND_API int zend_register_class_alias_ex(const char *name, size_t name_len, zen
|
||||||
|
|
||||||
zend_assert_valid_class_name(lcname);
|
zend_assert_valid_class_name(lcname);
|
||||||
|
|
||||||
|
lcname = zend_new_interned_string(lcname);
|
||||||
ce = zend_hash_add_ptr(CG(class_table), lcname, ce);
|
ce = zend_hash_add_ptr(CG(class_table), lcname, ce);
|
||||||
zend_string_release(lcname);
|
zend_string_release(lcname);
|
||||||
if (ce) {
|
if (ce) {
|
||||||
|
|
|
@ -200,6 +200,8 @@ PHP_MINIT_FUNCTION(zend_test)
|
||||||
zend_test_trait = zend_register_internal_class(&class_entry);
|
zend_test_trait = zend_register_internal_class(&class_entry);
|
||||||
zend_test_trait->ce_flags |= ZEND_ACC_TRAIT;
|
zend_test_trait->ce_flags |= ZEND_ACC_TRAIT;
|
||||||
zend_declare_property_null(zend_test_trait, "testProp", sizeof("testProp")-1, ZEND_ACC_PUBLIC);
|
zend_declare_property_null(zend_test_trait, "testProp", sizeof("testProp")-1, ZEND_ACC_PUBLIC);
|
||||||
|
|
||||||
|
zend_register_class_alias("_ZendTestClassAlias", zend_test_class);
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue