bearophile wrote:
but what are the big issues with checking for overflows

There are no big issues for checking for overflows.

Consider that every add instruction:

    ADD EAX,3

becomes 2 instructions:

    ADD EAX,3
    JC overflow

and every:

    LEA EAX,7[EBX*8][ECX]

becomes:

    MOV EAX,EBX
    IMUL EAX,3
    JC overflow
    ADD EAX,7
    JC overflow
    ADD EAX,ECX
    JC overflow

This is not a small penalty. Adds, multiplies, and subtracts are the bread and butter of what the executable code is.

Reply via email to