X64 was designed with this in mind. All non-active bits must be the same value (a so called canonical address) or the processor will fault. You can’t use them for flag bits unless you make sure to clear them before dereferencing memory.
No comments yet.