Mill Computing, Inc. Forums The Mill Architecture NULL pointer Reply To: NULL pointer

Ivan Godard
Post count: 689

The possibility is for legacy compatibility, for machines like the PDP-10 for which address zero had a hardware-defined meaning.Some future standard may deprecate it.

The Mill reserves more than the zero address, to catch code like:

struct S{int a; int b}; int* p = static_cast<struct S*>(NULL);
... //other code
int i = *p;

Of course app code won’t have permissions for ultra-low addresses, but system code may, and hardware poisoning the range helps catch bugs in privileged code. In addition, it lets the fault distinguish between (likely) null-pointer vs. wild address.

We try to be friendly.