Fix overflow check for multiplication:
authorse <se@FreeBSD.org>
Tue, 27 Jan 2015 18:04:41 +0000 (18:04 +0000)
committerse <se@FreeBSD.org>
Tue, 27 Jan 2015 18:04:41 +0000 (18:04 +0000)
commit4fcc96bc4a45d8d716c56ed403036aa6d4805351
tree86ce4c17b6bfb4b31eef245e89c775c6b500e9a0
parenta77bf6c232e17ab45b0fee221b4f9dd89d421f9e
Fix overflow check for multiplication:
- Add special test to detect the case of -1 * INTMAX_MIN
- Protect against elimination of the test division by the optimizer

Garrett Cooper noticed that the overflow checks were incomplete, and Bruce
Evans suggested the use of the "volatile" qualifier to counter the effect
of the undefined behaviour, when the prior multiplication caused overflow,
and he also suggested improvements to the comments.

Reviewed by: bde
MFC after: 1 week
bin/expr/expr.y