3 ms·
There's a subtlety here I was first going to say that this would only apply on embedded devices or kernel code But note, the problem here is not if overflowin
by raverbashing 2y ago
There's a subtlety here
I was first going to say that this would only apply on embedded devices or kernel code
But note, the problem here is not if overflowing (pointer + offset) points to a valid address, but simply if the calculation works
Though maybe you're right, I guess in modern platforms this almost always never apply and my rant is over the top
- foldr 2y agoThe calculation still works, you just can’t check if there was an overflow. I can imagine maybe doing that on, say, an embedded platform with a 16-bit address space. But this kind of code is going to be vastly less common than code that depends on signed integer overflow.