cvs: ZendEngine2 / zend_object_handlers.c
| From: | Marcus Boerger | Date: | Thu, 11 Dec 2003 09:56:06 +0000 |
| Subject: | cvs: ZendEngine2 / zend_object_handlers.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-2090@lists.php.net to get a copy of this message | ||
helly Thu Dec 11 04:56:06 2003 EDT
Modified files:
/ZendEngine2 zend_object_handlers.c
Log:
Handle getter failure and allow to bypass thrown exceptions.
Index: ZendEngine2/zend_object_handlers.c
diff -u ZendEngine2/zend_object_handlers.c:1.79 ZendEngine2/zend_object_handlers.c:1.80
--- ZendEngine2/zend_object_handlers.c:1.79 Tue Dec 2 17:08:51 2003
+++ ZendEngine2/zend_object_handlers.c Thu Dec 11 04:56:06 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_object_handlers.c,v 1.79 2003/12/02 22:08:51 helly Exp $ */
+/* $Id: zend_object_handlers.c,v 1.80 2003/12/11 09:56:06 helly Exp $ */
#include "zend.h"
#include "zend_globals.h"
@@ -358,6 +358,12 @@
if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) {
zend_call_method_with_1_params(&object, ce, NULL, "offsetget", &retval,
offset);
+ if (!retval) {
+ if (!EG(exception)) {
+ zend_error(E_ERROR, "Undefined offset for object of type %s used as array",
ce->name);
+ }
+ return 0;
+ }
if (retval->refcount > 0) { /* Should always be the case */
retval->refcount--;
}