| Marcus Boerger 2005-03-19, 3:55 pm |
| helly Sat Mar 19 10:32:19 2005 EDT
Modified files:
/ZendEngine2 zend_object_handlers.c
Log:
- More fixes to gracefully act on exception thrown in overload methods
http://cvs.php.net/diff.php/ZendEng...2&r2=1.113&ty=u
Index: ZendEngine2/zend_object_handlers.c
diff -u ZendEngine2/zend_object_handlers.c:1.112 ZendEngine2/zend_object_handlers.c:1.113
--- ZendEngine2/zend_object_handlers.c:1.112 Sat Mar 19 10:06:39 2005
+++ ZendEngine2/zend_object_handlers.c Sat Mar 19 10:32:18 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_object_handlers.c,v 1.112 2005/03/19 15:06:39 helly Exp $ */
+/* $Id: zend_object_handlers.c,v 1.113 2005/03/19 15:32:18 helly Exp $ */
#include "zend.h"
#include "zend_globals.h"
@@ -83,7 +83,7 @@
static int zend_std_call_setter(zval *object, zval *member, zval *value TSRMLS_DC)
{
zval *retval = NULL;
- int ret;
+ int result;
zend_class_entry *ce = Z_OBJCE_P(object);
SEPARATE_ARG_IF_REF(member);
@@ -100,17 +100,13 @@
zval_ptr_dtor(&member);
zval_ptr_dtor(&value);
- if (retval && zend_is_true(retval)) {
- ret = SUCCESS;
- } else {
- ret = FAILURE;
- }
-
if (retval) {
+ result = i_zend_is_true(retval) ? SUCCESS : FAILURE;
zval_ptr_dtor(&retval);
+ return result;
+ } else {
+ return FAILURE;
}
-
- return ret;
}
@@ -395,9 +391,13 @@
SEPARATE_ARG_IF_REF(offset);
zend_call_method_with_1_params(&object, ce, NULL, "offsetexists", &retval, offset);
zval_ptr_dtor(&offset);
- result = i_zend_is_true(retval);
- zval_ptr_dtor(&retval);
- return result;
+ if (retval) {
+ result = i_zend_is_true(retval);
+ zval_ptr_dtor(&retval);
+ return result;
+ } else {
+ return 0;
+ }
} else {
zend_error(E_ERROR, "Cannot use object of type %s as array", ce->name);
return 0;
|