Commit dd36abe
committed
Zend/zend_operators: fix casting underflowed unsigned to signed
Casting a huge unsigned value to signed is implementation-defined
behavior in C. By introducing the ZEND_THREEWAY_COMPARE() macro, we
can sidestep this integer overflow/underflow/casting problem.1 parent 733023b commit dd36abe
2 files changed
+12
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2956 | 2956 | | |
2957 | 2957 | | |
2958 | 2958 | | |
2959 | | - | |
| 2959 | + | |
2960 | 2960 | | |
2961 | 2961 | | |
2962 | 2962 | | |
| |||
2972 | 2972 | | |
2973 | 2973 | | |
2974 | 2974 | | |
2975 | | - | |
| 2975 | + | |
2976 | 2976 | | |
2977 | 2977 | | |
2978 | 2978 | | |
| |||
2997 | 2997 | | |
2998 | 2998 | | |
2999 | 2999 | | |
3000 | | - | |
| 3000 | + | |
3001 | 3001 | | |
3002 | 3002 | | |
3003 | 3003 | | |
| |||
3018 | 3018 | | |
3019 | 3019 | | |
3020 | 3020 | | |
3021 | | - | |
| 3021 | + | |
3022 | 3022 | | |
3023 | 3023 | | |
3024 | 3024 | | |
| |||
3040 | 3040 | | |
3041 | 3041 | | |
3042 | 3042 | | |
3043 | | - | |
| 3043 | + | |
3044 | 3044 | | |
3045 | 3045 | | |
3046 | 3046 | | |
| |||
3061 | 3061 | | |
3062 | 3062 | | |
3063 | 3063 | | |
3064 | | - | |
| 3064 | + | |
3065 | 3065 | | |
3066 | 3066 | | |
3067 | 3067 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
457 | 457 | | |
458 | 458 | | |
459 | 459 | | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
460 | 466 | | |
461 | 467 | | |
462 | 468 | | |
| |||
0 commit comments