cvs: ZendEngine2(PHP_5_3) / zend_execute.c zend_execute_API.c

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

  Modified files:              (Branch: PHP_5_3)
    /ZendEngine2	zend_execute.c zend_execute_API.c 
  Log:
  GC fix
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute.c?r1=1.716.2.12.2.24.2.27&r2=1.716.2.12.2.24.2.28&diff_format=u
Index: ZendEngine2/zend_execute.c
diff -u ZendEngine2/zend_execute.c:1.716.2.12.2.24.2.27 ZendEngine2/zend_execute.c:1.716.2.12.2.24.2.28
--- ZendEngine2/zend_execute.c:1.716.2.12.2.24.2.27	Mon May  5 11:03:32 2008
+++ ZendEngine2/zend_execute.c	Tue May  6 16:03:15 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_execute.c,v 1.716.2.12.2.24.2.27 2008/05/05 11:03:32 dmitry Exp $ */
+/* $Id: zend_execute.c,v 1.716.2.12.2.24.2.28 2008/05/06 16:03:15 dmitry Exp $ */
 
 #define ZEND_INTENSIVE_DEBUGGING 0
 
@@ -83,9 +83,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);
+		}
 	}
 }
 
@@ -699,9 +703,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.331.2.20.2.24.2.37&r2=1.331.2.20.2.24.2.38&diff_format=u
Index: ZendEngine2/zend_execute_API.c
diff -u ZendEngine2/zend_execute_API.c:1.331.2.20.2.24.2.37 ZendEngine2/zend_execute_API.c:1.331.2.20.2.24.2.38
--- ZendEngine2/zend_execute_API.c:1.331.2.20.2.24.2.37	Tue Apr 29 09:18:14 2008
+++ ZendEngine2/zend_execute_API.c	Tue May  6 16:03:16 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_execute_API.c,v 1.331.2.20.2.24.2.37 2008/04/29 09:18:14 dmitry Exp $ */
+/* $Id: zend_execute_API.c,v 1.331.2.20.2.24.2.38 2008/05/06 16:03:16 dmitry Exp $ */
 
 #include <stdio.h>
 #include <signal.h>
@@ -418,9 +418,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.