php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #60444
Patch bug60444.phpt revision 2011-12-05 08:19 UTC by laruence@php.net
Patch bug60444.patch revision 2011-12-05 08:18 UTC by laruence@php.net

Patch bug60444.patch for Reproducible crash Bug #60444

Patch version 2011-12-05 08:18 UTC

Return to Bug #60444 | Download this patch
Patch Revisions:

Developer: laruence@php.net

Index: Zend/zend_compile.c
===================================================================
--- Zend/zend_compile.c	(revision 320392)
+++ Zend/zend_compile.c	(working copy)
@@ -2871,7 +2871,12 @@
 	if (zend_hash_find(&ce->parent->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), (void **)&function)==SUCCESS) {
 		/* inherit parent's constructor */
 		zend_hash_update(&ce->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), function, sizeof(zend_function), NULL);
-		function_add_ref(function);
+		if (function->type == ZEND_USER_FUNCTION && function->op_array.run_time_cache) {
+			function_add_ref(function);
+			function->op_array.run_time_cache = ecalloc(function->op_array.last_cache_slot, sizeof(void*));
+		} else {
+			function_add_ref(function);
+		}
 	} else {
 		/* Don't inherit the old style constructor if we already have the new style constructor */
 		char *lc_class_name;
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 09:01:28 2024 UTC