summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2014-07-03 14:58:53 +0800
committerXinchen Hui <laruence@php.net>2014-07-03 14:58:53 +0800
commit4e16054b7a6543a20d96e017c25ff48560c362ce (patch)
treeb1adb68eed95a028e5b2f5fa3886478a81def823
parent1f6b877f7afafc1fed5af1d630836f5efa52e241 (diff)
parent2034ace0526657cbed0fafc3d77b1baa6604ae9e (diff)
downloadphp-git-4e16054b7a6543a20d96e017c25ff48560c362ce.tar.gz
Merge branch 'PHP-5.5' into PHP-5.6
-rw-r--r--ext/opcache/tests/bug67215.phpt28
-rw-r--r--ext/opcache/zend_accelerator_util_funcs.c13
2 files changed, 32 insertions, 9 deletions
diff --git a/ext/opcache/tests/bug67215.phpt b/ext/opcache/tests/bug67215.phpt
new file mode 100644
index 0000000000..e9919d1001
--- /dev/null
+++ b/ext/opcache/tests/bug67215.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Bug #67215 (php-cgi work with opcache, may be segmentation fault happen)
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.file_update_protection=0
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+$file_c = __DIR__ . "/bug67215.c.php";
+$file_p = __DIR__ . "/bug67215.p.php";
+file_put_contents($file_c, "<?php require \"$file_p\"; class c extends p {} ?>");
+file_put_contents($file_p, '<?php class p { protected $var = ""; } ?>');
+require $file_c;
+$a = new c();
+require $file_c;
+?>
+--CLEAN--
+<?php
+$file_c = __DIR__ . "/bug67215.c.php";
+$file_p = __DIR__ . "/bug67215.p.php";
+unlink($file_c);
+unlink($file_p);
+?>
+--EXPECTF--
+Fatal error: Cannot redeclare class c in %sbug67215.c.php on line %d
diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c
index ae33e765ca..33103e54d1 100644
--- a/ext/opcache/zend_accelerator_util_funcs.c
+++ b/ext/opcache/zend_accelerator_util_funcs.c
@@ -899,16 +899,11 @@ static int zend_hash_unique_copy(HashTable *target, HashTable *source, unique_co
if (p->nKeyLength > 0 && p->arKey[0] == 0) {
/* Mangled key */
#if ZEND_EXTENSION_API_NO >= PHP_5_3_X_API_NO
- if (((zend_function*)p->pData)->common.fn_flags & ZEND_ACC_CLOSURE) {
- /* update closure */
- if (zend_hash_quick_update(target, p->arKey, p->nKeyLength, p->h, p->pData, size, &t) == SUCCESS) {
- if (pCopyConstructor) {
- pCopyConstructor(t);
- }
+ if (zend_hash_quick_update(target, p->arKey, p->nKeyLength, p->h, p->pData, size, &t) == SUCCESS) {
+ if (pCopyConstructor) {
+ pCopyConstructor(t);
}
- } else {
- /* ignore and wait for runtime */
- }
+ }
#endif
} else if (!ignore_dups && zend_hash_quick_find(target, p->arKey, p->nKeyLength, p->h, &t) == SUCCESS) {
*fail_data = p->pData;