4 ms·
Wow, that's nuts. I'd have never expected that abuse. You can use -ftrapv to check for integer overflows, like this https://godbolt.org/z/snbdadv8b https://go
by mikewarot 4y ago
Wow, that's nuts. I'd have never expected that abuse.
You can use -ftrapv to check for integer overflows, like this
https://godbolt.org/z/snbdadv8b https://godbolt.org/z/snbdadv8b
>Let me know how you think you can work out if that lea overflowed!
LEA (Load Effective Address) can't overflow... memory is supposed to wrap, the byte after the last byte is byte 0.
- chrisseaton 4y agoRight but have you seen what that’s done to your machine code? That’s why people don’t do it normally. > LEA (Load Effective Address) can't overflow... You're mistaken - it's defined to overflow. https://reverseengineering.stackexchange.com/questions/11442/understanding-subtle-differences-between-addressing-modes-in-x86 https://reverseengineering.stackexchange.com/questions/11442...
- zorgmonkey 4y agoI'm not 100% sure, but I think that the behavior of LEA is to wrap, but it does not set the overflow flag