On Sun, Mar 07, 2010 at 12:11:26PM -0500, Tom Lane wrote: > Tim Bunce <tim.bu...@pobox.com> writes: > > I encountered a core dump running PL/Perl installcheck with a very > > recent git HEAD of PostgreSQL and a not quite so recent git HEAD of perl. > > > The cause is a subtle difference between SvTYPE(sv) == SVt_RV and > > SvROK(sv). The former is checking a low-level implementation detail > > while the later is directly checking "does this sv contains a reference". > > Hmm. Seems like this patch begs the question: if checking SvTYPE(*svp) > isn't safe, why is it safe to look at SvTYPE(SvRV(*svp))? Shouldn't the > tests against SVt_PVHV be made more abstract as well?
Some SvTYPE values, like SVt_RV, allow the SV to hold one of a number of different kinds of things. Others, like SVt_PVHV, don't. No, I don't like it either but that's the way the "Jenga tower made of yaks" (to use a phrase recently coined by one of the perl maintainers) has grown. Something like an SvRVHVOK(sv) would be welcome sugar. Tim. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers