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

Поиск
Список
Период
Сортировка
От Tim Bunce
Тема Re: Core dump running PL/Perl installcheck with bleadperl [PATCH]
Дата
Msg-id 20100308093632.GV1375@timac.local
обсуждение исходный текст
Ответ на Re: Core dump running PL/Perl installcheck with bleadperl [PATCH]  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Sun, Mar 07, 2010 at 12:11:26PM -0500, Tom Lane wrote:
> Tim Bunce <Tim.Bunce@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.


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Pierre C"
Дата:
Сообщение: Re: SQL compatibility reminder: MySQL vs PostgreSQL
Следующее
От: Marko Tiikkaja
Дата:
Сообщение: Re: SQL compatibility reminder: MySQL vs PostgreSQL