From: Andi Gutmans Date: Fri, 29 Oct 2004 00:55:11 +0000 (+0000) Subject: - For Ilia: X-Git-Tag: RELEASE_0_2~809 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b86cdbbddb1936dd0cf3ace0ebc2193bd20c9c9f;p=php - For Ilia: - MFH: Fixed bug #30572 (crash when comparing SimpleXML attribute to a boolean). - Hope this works well. I will MFH tomorrow if no one complains. --- diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 4fea659469..0e3caeaeaa 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -140,7 +140,7 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC) } #define zendi_convert_scalar_to_number(op, holder, result) \ - if (op==result) { \ + if (op==result || op->refcount == 0) { \ if (op->type != IS_LONG) { \ convert_scalar_to_number(op TSRMLS_CC); \ } \ @@ -194,7 +194,7 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC) } while (0) #define zendi_convert_to_long(op, holder, result) \ - if (op==result) { \ + if (op == result || op->refcount == 0) { \ convert_to_long(op); \ } else if ((op)->type != IS_LONG) { \ switch ((op)->type) { \ @@ -230,7 +230,7 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC) #define zendi_convert_to_boolean(op, holder, result) \ - if (op==result) { \ + if (op==result || op->refcount == 0) { \ convert_to_boolean(op); \ } else if ((op)->type != IS_BOOL) { \ switch ((op)->type) { \