3 ms·
Wouldn't this sort of thing be better handled by an exception? The CPU should help us more to write better secure software.
by GeorgeTirebiter 11y ago
Wouldn'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.