]> granicus.if.org Git - php/commitdiff
Keeping consistent arg_stack during arguments freeing (Exception from destructor...
authorDmitry Stogov <dmitry@php.net>
Wed, 31 May 2006 13:02:15 +0000 (13:02 +0000)
committerDmitry Stogov <dmitry@php.net>
Wed, 31 May 2006 13:02:15 +0000 (13:02 +0000)
Zend/zend_builtin_functions.c
Zend/zend_execute.h

index bf757894235bc04dd2bc3208f5655655556bd103..c544badf046d5f5cfa259c5e6402dd35c4ea0894 100644 (file)
@@ -1708,9 +1708,13 @@ static zval *debug_backtrace_get_args(void ***curpos TSRMLS_DC)
 
        while (--arg_count >= 0) {
                arg = (zval **) p++;
-               SEPARATE_ZVAL_TO_MAKE_IS_REF(arg);
-               (*arg)->refcount++;
-               add_next_index_zval(arg_array, *arg);
+               if (*arg) {
+                       SEPARATE_ZVAL_TO_MAKE_IS_REF(arg);
+                       (*arg)->refcount++;
+                       add_next_index_zval(arg_array, *arg);
+               } else {
+                       add_next_index_null(arg_array);
+               }
        }
 
        /* skip args from incomplete frames */
index 74773f2036fad29e5468ad2a0ab76b37e3f93c6c..09432f77b4be7a31ca191c13ff312462c0efd097 100644 (file)
@@ -152,7 +152,9 @@ static inline void zend_ptr_stack_clear_multiple(TSRMLS_D)
 
        EG(argument_stack).top -= (delete_count+2);
        while (--delete_count>=0) {
-               zval_ptr_dtor((zval **) --p);
+               zval *q = *(zval **)(--p);
+               *p = NULL;
+               zval_ptr_dtor(&q);
        }
        EG(argument_stack).top_element = p;
 }