computes x * y returns to true if x*y overflowed
| 22 | // computes x * y |
| 23 | // returns to true if x*y overflowed |
| 24 | bool safe_mul |
| 25 | ( |
| 26 | int x, // x |
| 27 | int y, // y |
| 28 | int *z // x*y |
| 29 | ) { |
| 30 | ASSERT(z != NULL); |
| 31 | return __builtin_mul_overflow(x, y, z); |
| 32 | } |
| 33 |