]> granicus.if.org Git - php/commitdiff
fix negating an unsigned
authorAnatol Belski <ab@php.net>
Mon, 15 Sep 2014 15:48:15 +0000 (17:48 +0200)
committerAnatol Belski <ab@php.net>
Mon, 15 Sep 2014 17:46:30 +0000 (19:46 +0200)
Zend/zend_operators.h

index 41342de0206104c50a1b58c0278ce92a9eb4eef8..a50e65d7c2a5f9f6e6a672c5457bea66b5b8aa74 100644 (file)
@@ -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));           \