We should have 1 recommended way for testing NULL registers. If we support get_bool() then lets make sure it works for REAL NULL pmc registers as well as PMCNULL.
If not, code will appear to work correctly on a "safe" core but will seg fault on some other. Also, I see no reason not to use PMCNULL in all cores now. -Melvin Leopold Toetsch <[EMAIL PROTECTED]> 12/03/2003 10:43 AM Please respond to lt To: [EMAIL PROTECTED] (Juergen Boemmels) cc: [EMAIL PROTECTED] Subject: Re: [RfC] Testing for null Juergen Boemmels <[EMAIL PROTECTED]> wrote: > Hi, > I'm curently playing around with open calls returning a PMCNULL > instead of a half valid IO-Object. But the main problem with that is > that there is currently no way for the byte-code to detect such a > case. C<defined> tests for PMCNULL too and is usable. > * A PMCNULL has false semantics. This may be done by letting > get_boolean return FALSE, or by adding a test to if_p_ic op: > if(!PMC_IS_NULL($1) && $1->vtable->get_boolean($1)) Or the null.pmc gets a valid get_bool() vtable slot returning 0. OTOH when PMCNULL is a real NULL, this will fail then. > * Have a special op for this if_null and unless_null which exlusively > test for NULL. Probably better. > boe leo