com php-src: Merge branch 'PHP-5.6': ext/dom/php_dom.c

From: Date: Sun, 12 Oct 2014 04:55:24 +0000
Subject: com php-src: Merge branch 'PHP-5.6': ext/dom/php_dom.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-82251@lists.php.net to get a copy of this message
Commit: ea7604fc9e481318d9219bcc8b29125079965895 Author: Tjerk Meesters <datibbaw@php.net> Sun, 12 Oct 2014 12:55:24 +0800 Parents: e33e4b2d8c44fb04afc54f688ed44dce7e8a2e0f 37a685ff2bed7bda213c53604ad8cc6dc470751c Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ea7604fc9e481318d9219bcc8b29125079965895 Log: Merge branch 'PHP-5.6' * PHP-5.6: More fixes for nodelist array access - testing for null property read - no zval copying if the type is already long - memory fix for master - use zend_long for offset Conflicts: ext/dom/php_dom.c Changed paths: MM ext/dom/php_dom.c Diff: diff --cc ext/dom/php_dom.c index 71c0661,4e035c7..c25cbab --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@@ -1552,31 -1702,29 +1552,24 @@@ zval *dom_nodelist_read_dimension(zval return NULL; } - ZVAL_COPY(&offset_copy, offset); - convert_to_long(&offset_copy); - ZVAL_LONG(&offset_copy, dom_get_long(offset)); ++ ZVAL_LONG(&offset_copy, zval_get_long(offset)); - zend_call_method_with_1_params(&object, Z_OBJCE_P(object), NULL, "item", &rv, &offset_copy); - - Z_DELREF_P(rv); + zend_call_method_with_1_params(object, Z_OBJCE_P(object), NULL, "item", rv, &offset_copy); return rv; } /* }}} end dom_nodelist_read_dimension */ int dom_nodelist_has_dimension(zval *object, zval *member, int check_empty TSRMLS_DC) { - zval *length, offset_copy; - int ret; - - ZVAL_COPY(&offset_copy, member); - convert_to_long(&offset_copy); - long offset = dom_get_long(member); ++ zend_long offset = zval_get_long(member); - if (Z_LVAL(offset_copy) < 0) { + if (offset < 0) { return 0; - } - - length = zend_read_property(Z_OBJCE_P(object), object, "length", sizeof("length") - 1, 0 TSRMLS_CC); - - ret = Z_LVAL(offset_copy) < Z_LVAL_P(length); + } else { + zval *length = zend_read_property(Z_OBJCE_P(object), object, "length", sizeof("length") - 1, 0 TSRMLS_CC); - int ret = length && offset < Z_LVAL_P(length); - - FREE_ZVAL(length); - return ret; - return ret; ++ return length && offset < Z_LVAL_P(length); + } } /* }}} end dom_nodelist_has_dimension */ #endif /* HAVE_DOM */

« previous php.cvs (#82251) next »