rfc:range_checks_for_64_bit
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:range_checks_for_64_bit [2015/08/24 15:48] – ab | rfc:range_checks_for_64_bit [2015/08/24 16:00] – ab | ||
---|---|---|---|
Line 33: | Line 33: | ||
# define ZEND_LONG_INT_OVFL(zlong) ((zlong) > (zend_long)INT_MAX) | # define ZEND_LONG_INT_OVFL(zlong) ((zlong) > (zend_long)INT_MAX) | ||
# define ZEND_LONG_INT_UDFL(zlong) ((zlong) < (zend_long)INT_MIN) | # define ZEND_LONG_INT_UDFL(zlong) ((zlong) < (zend_long)INT_MIN) | ||
+ | #endif | ||
+ | |||
+ | #if SIZEOF_INT == SIZEOF_ZEND_LONG | ||
+ | # define ZEND_LONG_UINT_OVFL(zl) (0) | ||
+ | #else | ||
+ | # define ZEND_LONG_UINT_OVFL(zlong) ((zlong) < 0 || (zlong) > (zend_long)UINT_MAX) | ||
#endif | #endif | ||
#define ZEND_SIZE_T_INT_OVFL(size) ((size) > (size_t)INT_MAX) | #define ZEND_SIZE_T_INT_OVFL(size) ((size) > (size_t)INT_MAX) | ||
+ | #define ZEND_SIZE_T_UINT_OVFL(size) ((size) > (size_t)UINT_MAX) | ||
</ | </ | ||
Line 48: | Line 55: | ||
</ | </ | ||
- | All the macros should be put into a dedicated header, so any extensions can be put there. | + | All the macros should be put into a dedicated header, so any extensions |
==== Proposed ZPP changes ==== | ==== Proposed ZPP changes ==== |
rfc/range_checks_for_64_bit.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1