cvs: ZendEngine2 / zend.c zend_exceptions.c zend_execute_API.c
| From: | Andi Gutmans | Date: | Mon, 01 Mar 2004 13:29:46 +0000 |
| Subject: | cvs: ZendEngine2 / zend.c zend_exceptions.c zend_execute_API.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-2430@lists.php.net to get a copy of this message | ||
andi Mon Mar 1 08:29:46 2004 EDT
Modified files:
/ZendEngine2 zend.c zend_exceptions.c zend_execute_API.c
Log:
- Fix crash in exception handling (zend_exception_error(...) and
zend_eval_string_ex() were buggy (Dmitry, Andi)
http://cvs.php.net/diff.php/ZendEngine2/zend.c?r1=1.270&r2=1.271&ty=u
Index: ZendEngine2/zend.c
diff -u ZendEngine2/zend.c:1.270 ZendEngine2/zend.c:1.271
--- ZendEngine2/zend.c:1.270 Wed Feb 25 05:57:09 2004
+++ ZendEngine2/zend.c Mon Mar 1 08:29:45 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend.c,v 1.270 2004/02/25 10:57:09 zeev Exp $ */
+/* $Id: zend.c,v 1.271 2004/03/01 13:29:45 andi Exp $ */
#include "zend.h"
#include "zend_extensions.h"
@@ -1061,8 +1061,6 @@
}
} else {
zend_exception_error(EG(exception) TSRMLS_CC);
- zval_ptr_dtor(&EG(exception));
- EG(exception) = NULL;
}
efree(params);
zval_ptr_dtor(&old_exception);
@@ -1072,8 +1070,6 @@
}
} else {
zend_exception_error(EG(exception) TSRMLS_CC);
- zval_ptr_dtor(&EG(exception));
- EG(exception) = NULL;
}
if (retval == NULL && *EG(return_value_ptr_ptr) != NULL) {
zval_ptr_dtor(EG(return_value_ptr_ptr));
http://cvs.php.net/diff.php/ZendEngine2/zend_exceptions.c?r1=1.60&r2=1.61&ty=u
Index: ZendEngine2/zend_exceptions.c
diff -u ZendEngine2/zend_exceptions.c:1.60 ZendEngine2/zend_exceptions.c:1.61
--- ZendEngine2/zend_exceptions.c:1.60 Wed Feb 25 08:11:00 2004
+++ ZendEngine2/zend_exceptions.c Mon Mar 1 08:29:45 2004
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_exceptions.c,v 1.60 2004/02/25 13:11:00 sniper Exp $ */
+/* $Id: zend_exceptions.c,v 1.61 2004/03/01 13:29:45 andi Exp $ */
#include "zend.h"
#include "zend_API.h"
@@ -508,12 +508,12 @@
va_end(args);
}
+/* This function doesn't return as it calls E_ERROR */
ZEND_API void zend_exception_error(zval *exception TSRMLS_DC)
{
zend_class_entry *ce_exception = Z_OBJCE_P(exception);
if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {
zval *str, *file, *line;
- zval *old_exception = EG(exception);
EG(exception) = NULL;
@@ -543,8 +543,6 @@
file = zend_read_property(default_exception_ce, exception, "file",
sizeof("file")-1, 1 TSRMLS_CC);
line = zend_read_property(default_exception_ce, exception, "line",
sizeof("line")-1, 1 TSRMLS_CC);
- EG(exception) = old_exception;
-
zend_error_va(E_ERROR, Z_STRVAL_P(file), Z_LVAL_P(line), "Uncaught %s\n thrown",
Z_STRVAL_P(str));
} else {
zend_error(E_ERROR, "Uncaught exception '%s'", ce_exception->name);
http://cvs.php.net/diff.php/ZendEngine2/zend_execute_API.c?r1=1.271&r2=1.272&ty=u
Index: ZendEngine2/zend_execute_API.c
diff -u ZendEngine2/zend_execute_API.c:1.271 ZendEngine2/zend_execute_API.c:1.272
--- ZendEngine2/zend_execute_API.c:1.271 Wed Feb 25 05:57:10 2004
+++ ZendEngine2/zend_execute_API.c Mon Mar 1 08:29:45 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_execute_API.c,v 1.271 2004/02/25 10:57:10 zeev Exp $ */
+/* $Id: zend_execute_API.c,v 1.272 2004/03/01 13:29:45 andi Exp $ */
#include <stdio.h>
#include <signal.h>
@@ -926,16 +926,10 @@
ZEND_API int zend_eval_string_ex(char *str, zval *retval_ptr, char *string_name, int
handle_exceptions TSRMLS_DC)
{
int result;
- zval *exception = EG(exception);
- if (handle_exceptions) {
- EG(exception) = NULL;
- }
result = zend_eval_string(str, retval_ptr, string_name TSRMLS_CC);
if (handle_exceptions && EG(exception)) {
zend_exception_error(EG(exception) TSRMLS_CC);
- zval_ptr_dtor(&EG(exception));
- EG(exception) = exception;
result = FAILURE;
}
return result;