it turns out a bug (that I introduced) in mod_perl 1.0 core could be boiled down to this simple XS:
RETVAL = Nullsv; if (! SvOK(RETVAL)) { ... }
Nullsv
really expands to #define Nullsv Null(SV*)
#define Null(type) ((type)NULL)
SvOK
not to protect against situations like these, especially while SvTRUE
is DWIMmy. but that's just me.
SvOK
to check that an SV is non-NULL, oups. Whereas I only used SvTRUE
after I tested for nun-NULLness (with the help of SvOK
of course:-).SvOK
adding a NULL-check would probably be in order.
Re:Didn't know it either
rafael on 2004-03-10T09:09:51
I'd rather have a doc patch. Lots of macros don't check the nullness of their argument. As a matter of fact null SVs are quite rare compared to &PL_sv_undef or &PL_sv_no.Re:Didn't know it either
geoff on 2004-03-10T18:05:22
--- sv.h 2004-03-07 09:06:01.000000000 -0800
+++ sv.h~ 2004-03-10 10:03:23.000000000 -0800
@@ -428,7 +428,8 @@
Unsets the NV/IV status of an SV.
=for apidoc Am|bool|SvOK|SV* sv
-Returns a boolean indicating whether the value is an SV.
+Returns a boolean indicating whether the value is an SV. Does not protect
+against NULL SVs, such as those created by C<Nullsv>.
=for apidoc Am|bool|SvIOKp|SV* sv
Returns a boolean indicating whether the SV contains an integer. Checks