cvs: ZendEngine2 / zend_objects.c

"Marcus Boerger" <[email protected]>
Newsgroups gmane.comp.php.cvs.zend
Message-ID <cvshelly1215985024@cvsserver>
helly		Sun Jul 13 21:37:04 2008 UTC

  Modified files:              
    /ZendEngine2	zend_objects.c 
  Log:
  - Fix old workaround, since we are not C++ we can deal with exceptions in
    dtors (whether or not an exception is already pending).
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_objects.c?r1=1.76&r2=1.77&diff_format=u
Index: ZendEngine2/zend_objects.c
diff -u ZendEngine2/zend_objects.c:1.76 ZendEngine2/zend_objects.c:1.77
--- ZendEngine2/zend_objects.c:1.76	Mon Dec 31 07:12:07 2007
+++ ZendEngine2/zend_objects.c	Sun Jul 13 21:37:04 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_objects.c,v 1.76 2007/12/31 07:12:07 sebastian Exp $ */
+/* $Id: zend_objects.c,v 1.77 2008/07/13 21:37:04 helly Exp $ */
 
 #include "zend.h"
 #include "zend_globals.h"
@@ -100,20 +100,7 @@
 		old_exception = EG(exception);
 		EG(exception) = NULL;
 		zend_call_method_with_0_params(&obj, object->ce, &destructor, ZEND_DESTRUCTOR_FUNC_NAME, NULL);
-		if (old_exception) {
-			if (EG(exception)) {
-				zend_class_entry *default_exception_ce = zend_exception_get_default(TSRMLS_C);
-				zval *file = zend_read_property(default_exception_ce, old_exception, "file", sizeof("file")-1, 1 TSRMLS_CC);
-				zval *line = zend_read_property(default_exception_ce, old_exception, "line", sizeof("line")-1, 1 TSRMLS_CC);
-
-				zval_ptr_dtor(&obj);
-				zval_ptr_dtor(&EG(exception));
-				EG(exception) = old_exception;
-				zend_error(E_ERROR, "Ignoring exception from %v::__destruct() while an exception is already active (Uncaught %v in %R on line %ld)", 
-					object->ce->name, Z_OBJCE_P(old_exception)->name, Z_TYPE_P(file), Z_UNIVAL_P(file), Z_LVAL_P(line));
-			}
-			EG(exception) = old_exception;
-		}
+		zend_exception_set_previous(old_exception TSRMLS_CC);
 		zval_ptr_dtor(&obj);
 	}
 }



-- 
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
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.