From f25419f8e362faf96005ae6f78a7f901dfbcb971 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Sat, 21 Feb 2015 22:44:51 +0800 Subject: [PATCH] Only do this in debug build --- Zend/zend_closures.c | 4 +++- Zend/zend_object_handlers.c | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index 3943b7105a..37f8d55bd3 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -63,7 +63,9 @@ ZEND_METHOD(Closure, __invoke) /* {{{ */ /* destruct the function also, then - we have allocated it in get_method */ zend_string_release(func->internal_function.function_name); efree(func); - EX(func) = NULL; +#if ZEND_DEBUG + execute_data->func = NULL; +#endif } /* }}} */ diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index eba9cea43c..6c0e2f3533 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -934,7 +934,9 @@ ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{ */ /* destruct the function also, then - we have allocated it in get_method */ efree_size(func, sizeof(zend_internal_function)); +#if ZEND_DEBUG execute_data->func = NULL; +#endif } /* }}} */ @@ -1155,7 +1157,9 @@ ZEND_API void zend_std_callstatic_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{ /* destruct the function also, then - we have allocated it in get_method */ efree_size(func, sizeof(zend_internal_function)); +#if ZEND_DEBUG execute_data->func = NULL; +#endif } /* }}} */ -- 2.50.1