HomeFreeBSD

Fix overflow check for multiplication:

Description

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

Details

Provenance
seAuthored on
Parents
rS277797: key_spdget uses key_setdumpsp() without SPTREE_RLOCK held (it uses
Branches
Unknown
Tags
Unknown

Event Timeline