3 ms·
The responsibility for this lies not with just the programmers, but the address decode logic. The hardware should have seg faulted on non-zero upper bits (which
by WalterBright 7y ago
The responsibility for this lies not with just the programmers, but the address decode logic. The hardware should have seg faulted on non-zero upper bits (which would have required the addition of a few OR gates, hardly a problem).
- caf 7y agoThe hardware - at least, x86-64 hardware - does raise an exception on use of a non-canonical address. So to use these dirty tricks successfully, you have to mask out those bits before you dereference your pointer.