Core dump running PL/Perl installcheck with bleadperl [PATCH]

Tim Bunce <tim.bunce@pobox.com>

From: Tim Bunce <Tim.Bunce@pobox.com>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Cc: Tim Bunce <Tim.Bunce@pobox.com>
Date: 2010-03-05T15:26:51Z
Lists: pgsql-hackers

Attachments

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".

The attached patch fixes the problem by changing the SvTYPE check to use
SvROK instead. Although I only tripped over one case, the patch changes
all four uses of SvTYPE(sv) == SVt_RV. The remaining uses of SvTYPE are ok.

Tim.