On 2016-11-25 18:39:28 +0100, Torbjörn Granlund wrote:
> I assume "undefined" means that the computer will not explode, or even
> cause any less dramatic security issues, or even terminate execution.
Compilers use the fact that undefined behavior must not occur to
do some optimizations, like removing what appears as dead code
(but actually isn't). So, this can yield crashes and security issues.
See for instance the invalid bug:
"assert(int+100 > int) optimized away"
and the following article:
So, with some codes that intended to detect buffer overflow or
integer overflow with code like the above one, the check was no
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
gmp-devel mailing list