2 ms·
More so, using 'JO' (jump overflow) after every signed operation isn't that expensive, speedwise (branch prediction for the win) but it does make the code large
by spc476 11y ago
More so, using 'JO' (jump overflow) after every signed operation isn't that expensive, speedwise (branch prediction for the win) but it does make the code larger. http://boston.conman.org/2015/09/07.1 http://boston.conman.org/2015/09/07.1
- GeorgeTirebiter 11y agoWouldn't this sort of thing be better handled by an exception? The CPU should help us more to write better secure software.
- spc476 11y agoIt would, but the x86 doesn't trap on signed overflow. There is an INTO instruction (interrupt on signed overflow) but you have to include it after every signed instruction, and when I tested that, it was apparent that INTO is not a "fast instruction". Also, under Linux, when INTO fires, it is interpreted as a SIGSEGV. Not what I was expecting.