Security professionals who cannot write a correct integer overflow / pointer overflow check remind me of arsonist firefighters.
-
-
Replying to @volatile_void
what *is* the right way to implement an integer overflow? other than -ftrapv :P
2 replies 0 retweets 0 likes -
Replying to @hirojin
x = (int)((unsigned) y + (unsigned) z); is under-used. So is long long. Compilers do quite well on both.
2 replies 0 retweets 3 likes -
-
Replying to @johnregehr @hirojin
What's wrong with the __builtins? https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html …
1 reply 0 retweets 0 likes -
That they're not C but "GNU C" and gcc fails to pattern-recognize & optimize portable checks.
2 replies 0 retweets 2 likes -
how is LLVM doing wrt recognizing portable checks?
1 reply 0 retweets 0 likes -
Also failing I think. Most important one is a>TYPE_MAX/b. Trivial to opt as mul+cc check.
2 replies 0 retweets 0 likes -
can you give a gcc explorer link? I can try to fix
1 reply 0 retweets 1 like -
On mobile browser atm but just int f(unsigned a,unsigned b) {return a>UINT_MAX/b;}
5 replies 0 retweets 1 like
Also after div->mul opt, compiler should cse with a subsequent mul.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.