cvs: ZendEngine2 / zend_execute.c zend_execute_API.c

[email protected] ("Dmitry Stogov")
Newsgroups php.zend-engine.cvs
Message-ID <cvsdmitry1210089771@cvsserver>
dmitry		Tue May  6 16:02:51 2008 UTC

  Modified files:              
    /ZendEngine2	zend_execute.c zend_execute_API.c 
  Log:
  GC fix
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute.c?r1=1.795&r2=1.796&diff_format=u
Index: ZendEngine2/zend_execute.c
diff -u ZendEngine2/zend_execute.c:1.795 ZendEngine2/zend_execute.c:1.796
--- ZendEngine2/zend_execute.c:1.795	Mon May  5 11:02:45 2008
+++ ZendEngine2/zend_execute.c	Tue May  6 16:02:50 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_execute.c,v 1.795 2008/05/05 11:02:45 dmitry Exp $ */
+/* $Id: zend_execute.c,v 1.796 2008/05/06 16:02:50 dmitry Exp $ */
 
 #define ZEND_INTENSIVE_DEBUGGING 0
 
@@ -85,9 +85,13 @@
 static inline void zend_pzval_unlock_free_func(zval *z) /* {{{ */
 {
 	if (!Z_DELREF_P(z)) {
-		GC_REMOVE_ZVAL_FROM_BUFFER(z);
-		zval_dtor(z);
-		safe_free_zval_ptr(z);
+		TSRMLS_FETCH();
+
+		if (z != &EG(uninitialized_zval)) {
+			GC_REMOVE_ZVAL_FROM_BUFFER(z);
+			zval_dtor(z);
+			efree(z);
+		}
 	}
 }
 /* }}} */
@@ -778,9 +782,11 @@
 				} else {
 					Z_ADDREF_P(value);
 					*variable_ptr_ptr = value;
-					GC_REMOVE_ZVAL_FROM_BUFFER(variable_ptr);
-					zendi_zval_dtor(*variable_ptr);
-					safe_free_zval_ptr(variable_ptr);
+					if (variable_ptr != &EG(uninitialized_zval)) {
+						GC_REMOVE_ZVAL_FROM_BUFFER(variable_ptr);
+						zval_dtor(variable_ptr);
+						efree(variable_ptr);
+					}
 					return value;
 				}
 			} else {
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute_API.c?r1=1.445&r2=1.446&diff_format=u
Index: ZendEngine2/zend_execute_API.c
diff -u ZendEngine2/zend_execute_API.c:1.445 ZendEngine2/zend_execute_API.c:1.446
--- ZendEngine2/zend_execute_API.c:1.445	Tue Apr 29 09:18:43 2008
+++ ZendEngine2/zend_execute_API.c	Tue May  6 16:02:50 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_execute_API.c,v 1.445 2008/04/29 09:18:43 dmitry Exp $ */
+/* $Id: zend_execute_API.c,v 1.446 2008/05/06 16:02:50 dmitry Exp $ */
 
 #include <stdio.h>
 #include <signal.h>
@@ -445,9 +445,13 @@
 #endif
 	Z_DELREF_PP(zval_ptr);
 	if (Z_REFCOUNT_PP(zval_ptr) == 0) {
-		GC_REMOVE_ZVAL_FROM_BUFFER(*zval_ptr);
-		zval_dtor(*zval_ptr);
-		safe_free_zval_ptr_rel(*zval_ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC);
+		TSRMLS_FETCH();
+
+		if (*zval_ptr != &EG(uninitialized_zval)) {
+			GC_REMOVE_ZVAL_FROM_BUFFER(*zval_ptr);
+			zval_dtor(*zval_ptr);
+			efree_rel(*zval_ptr);
+		}
 	} else {
 		TSRMLS_FETCH();
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.