I've patched in a quick and dirty implementation of the previous discussion regarding Parrot segfaulting on access to a null register. Of course, HLL compilers shouldn't generate code that results in an uninitialized Px register, but we would like to do something more elegant than just dump core.
You'll have to edit interpreter.h and set PARROT_CATCH_NULL to 1 to enable it.
The patch adds the Null PMC class, only instantiated once in system memory. PMC register banks are set to PMCNULL now. The null op returns PMCNULL as well. Also patched it into extend.c so extension writers can get at it.
I didn't turn it on by default yet as we need to check over the code to see where assumptions are being made about PMC pointers just being NULL. However, all tests pass except the pmc create test (you can't do a new .Null).
This is good enough to start, I think. We should also integrate the null.pmc generation into pmc2c or pmc2c2.
-Melvin