cvs: ZendEngine2 / zend.c
| From: | Marcus Boerger | Date: | Thu, 02 Mar 2006 00:40:19 +0000 |
| Subject: | cvs: ZendEngine2 / zend.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-4635@lists.php.net to get a copy of this message | ||
helly Thu Mar 2 00:40:19 2006 UTC
Modified files:
/ZendEngine2 zend.c
Log:
- Use object handler get in the same way as the rest of the engine does
http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend.c?r1=1.340&r2=1.341&diff_format=u
Index: ZendEngine2/zend.c
diff -u ZendEngine2/zend.c:1.340 ZendEngine2/zend.c:1.341
--- ZendEngine2/zend.c:1.340 Wed Mar 1 16:18:35 2006
+++ ZendEngine2/zend.c Thu Mar 2 00:40:19 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend.c,v 1.340 2006/03/01 16:18:35 helly Exp $ */
+/* $Id: zend.c,v 1.341 2006/03/02 00:40:19 helly Exp $ */
#include "zend.h"
#include "zend_extensions.h"
@@ -358,16 +358,19 @@
}
if (Z_OBJ_HANDLER_P(expr, get)) {
zval *z = Z_OBJ_HANDLER_P(expr, get)(expr TSRMLS_CC);
+
+ z->refcount++;
if(Z_TYPE_P(z) != IS_OBJECT) {
zend_make_string_zval(z, expr_copy, use_copy);
if (*use_copy) {
- FREE_ZVAL(z);
+ zval_ptr_dtor(&z);
} else {
ZVAL_ZVAL(expr_copy, z, 0, 1);
*use_copy = 1;
}
return;
}
+ zval_ptr_dtor(&z);
}
zend_error(EG(exception) ? E_ERROR : E_RECOVERABLE_ERROR, "Object of class %v could not be
converted to string", Z_OBJCE_P(expr)->name);
ZVAL_EMPTY_STRING(expr_copy);
@@ -424,16 +427,19 @@
}
if (Z_OBJ_HANDLER_P(expr, get)) {
zval *z = Z_OBJ_HANDLER_P(expr, get)(expr TSRMLS_CC);
+
+ z->refcount++;
if(Z_TYPE_P(z) != IS_OBJECT) {
zend_make_printable_zval(z, expr_copy, use_copy);
if (*use_copy) {
- FREE_ZVAL(z);
+ zval_ptr_dtor(&z);
} else {
ZVAL_ZVAL(expr_copy, z, 0, 1);
*use_copy = 1;
}
return;
}
+ zval_ptr_dtor(&z);
}
zend_error(EG(exception) ? E_ERROR : E_RECOVERABLE_ERROR, "Object of class %v could not be
converted to string", Z_OBJCE_P(expr)->name);
ZVAL_EMPTY_STRING(expr_copy);
@@ -473,16 +479,19 @@
}
if (Z_OBJ_HANDLER_P(expr, get)) {
zval *z = Z_OBJ_HANDLER_P(expr, get)(expr TSRMLS_CC);
+
+ z->refcount++;
if(Z_TYPE_P(z) != IS_OBJECT) {
zend_make_unicode_zval(z, expr_copy, use_copy);
if (*use_copy) {
- FREE_ZVAL(z);
+ zval_ptr_dtor(&z);
} else {
ZVAL_ZVAL(expr_copy, z, 0, 1);
*use_copy = 1;
}
return;
}
+ zval_ptr_dtor(&z);
}
zend_error(EG(exception) ? E_ERROR : E_RECOVERABLE_ERROR, "Object of class %v could not be
converted to string", Z_OBJCE_P(expr)->name);
ZVAL_EMPTY_UNICODE(expr_copy);