Hacker News new | ask | show | jobs
by ptman 34 days ago
So what happens when you write through the nil pointer?
2 comments

Well, what happens when you write through an invalid pointer? The runtime can swallow the write or crash the program or allocate new storage and replace the pointer. Depends on the wanted semantics.
Nil of course (nothing happens). Not saying it’s a good idea, it would just be consistent.