com php-src: fix negating an unsigned: Zend/zend_operators. h
| From: | Anatol Belski | Date: | Mon, 15 Sep 2014 17:46:30 +0000 |
| Subject: | com php-src: fix negating an unsigned: Zend/zend_operators. h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81656@lists.php.net to get a copy of this message | ||
Commit: e0ff5238c5d744509f93aaf914e23f17d51c5ae3
Author: Anatol Belski <ab@php.net> Mon, 15 Sep 2014 17:48:15 +0200
Parents: 383a0773ff27cf57b94fe11d2f825b00cff88714
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e0ff5238c5d744509f93aaf914e23f17d51c5ae3
Log:
fix negating an unsigned
Changed paths:
M Zend/zend_operators.h
Diff:
diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h
index 41342de..a50e65d 100644
--- a/Zend/zend_operators.h
+++ b/Zend/zend_operators.h
@@ -1036,7 +1036,7 @@ static zend_always_inline void fast_is_not_identical_function(zval *result,
zval
/* buf points to the END of the buffer */
#define _zend_print_signed_to_buf(buf, num, vartype, result) do { \
if (num < 0) { \
- _zend_print_unsigned_to_buf((buf), -(vartype)(num), vartype, (result)); \
+ _zend_print_unsigned_to_buf((buf), (~((vartype)(num)) + 1), vartype, (result)); \
*--(result) = '-'; \
} else { \
_zend_print_unsigned_to_buf((buf), (num), vartype, (result)); \