Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_operators.c

From: Date: Tue, 26 Oct 2004 23:29:20 +0000
Subject: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_operators.c
References: 1  Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-3110@lists.php.net to get a copy of this message
Can you please explain this fix? I'm not sure it's correct and if it is then half of operators.c is buggy. It looks more like a SimpleXML bug to me. This really looks like the wrong fix. Please revert in the meanwhile. Andi At 10:38 PM 10/26/2004 +0000, Ilia Alshanetsky wrote:
iliaa           Tue Oct 26 18:38:34 2004 EDT
Modified files:
    /ZendEngine2        zend_operators.c
Log: Fixed bug #30228 (crash when comparing SimpleXML attribute to a boolean). http://cvs.php.net/diff.php/ZendEngine2/zend_operators.c?r1=1.198&r2=1.199&ty=u Index: ZendEngine2/zend_operators.c diff -u ZendEngine2/zend_operators.c:1.198 ZendEngine2/zend_operators.c:1.199 --- ZendEngine2/zend_operators.c:1.198 Wed Oct 20 13:57:28 2004
+++ ZendEngine2/zend_operators.c        Tue Oct 26 18:38:34 2004
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
*/ -/* $Id: zend_operators.c,v 1.198 2004/10/20 17:57:28 andi Exp $ */ +/* $Id: zend_operators.c,v 1.199 2004/10/26 22:38:34 iliaa Exp $ */ #include <ctype.h> @@ -1323,7 +1323,11 @@
        if (op1->type == IS_BOOL || op2->type == IS_BOOL
                || op1->type == IS_NULL || op2->type == IS_NULL) {
-               zendi_convert_to_boolean(op1, op1_copy, result);
+               if (free_op1) {
+                       convert_to_boolean(op1);
+               } else {
+                       zendi_convert_to_boolean(op1, op1_copy, result);
+               }
                zendi_convert_to_boolean(op2, op2_copy, result);
                result->type = IS_LONG;
                result->value.lval = ZEND_NORMALIZE_BOOL(op1->value.lval-op2->value.lval);
-- Zend Engine CVS Mailing List (http://cvs.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.zend-engine.cvs (#3110) next »