diff options
author | Xi Wang <xi@mit.edu> | 2013-02-20 12:45:45 -0500 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2013-02-20 19:12:51 +0100 |
commit | 79cd5fb435d910233b1eb03c93c6ae05908ab42b (patch) | |
tree | 3e29124e9dec22cc00fa5fd4a02524a723fb8e52 /libc/stdio/getchar_unlocked.c | |
parent | 3d791bda2e68136e5cfc52b5386e0db805b5d3ba (diff) |
nice: fix overflow checking in int_add_no_wrap()
In C, signed integer overflow is undefined behavior. Many compilers
optimize away checks like `a + b < a'.
Use safe precondition testing instead.
Signed-off-by: Xi Wang <xi@mit.edu>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc/stdio/getchar_unlocked.c')
0 files changed, 0 insertions, 0 deletions