The fact that safe language implementations have to think hard about how to handle null pointer exceptions safely should have been a warning sign that null pointers are a bad thing to have in a language. Sadly nearly always unheeded.
-
-
Even worse, what do you do when you catch the SIGSEGV? You probably want to unwind the stack, but doing that efficiently requires that your faulting address have a landing pad. So you have to generate landing pads at every pointer load…
-
I don’t think LLVM even supports generation of landing pads at anything but call instructions. So then you can’t use load instructions for pointers anymore. You will probably need to write an LLVM intrinsic that you invoke.
- 5 more replies
New conversation -
-
-
Isn’t it as simple as emitting a null check at the point of dereference? That’s how Optional works after all.
-
That’s a *big* performance cost though. Not only in the cost of the actual test-and-branch, but also in the optimizations you inhibit.
- 4 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.