Hi,
perl5.10.1 -e '//;Tie::Hash::NamedCapture::FIRSTKEY(undef)' segfaults.
regards,
--
Björn Höhrmann · mailto:bjo...@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
Thanks for the bug report.
With a build of blead with assertions enabled, I see:
$ ./perl -Ilib -e '//;Tie::Hash::NamedCapture::FIRSTKEY(undef)'
perl: universal.c:1500: XS_Tie_Hash_NamedCapture_FIRSTK: Assertion `((svtype)((_svrv)->sv_flags & 0xff)) >= SVt_PV || ((svtype)((_svrv)->sv_flags & 0xff)) == SVt_IV' failed.
Aborted
So the bug is still present.
That line is:
flags = (U32)INT2PTR(IV,SvIV(SvRV(MUTABLE_SV(ST(0)))));
I'm guessing that the problem is that SvRV() is being used without first
checking that SvROK() is true - ie that there is a valid reference to follow.
Nicholas Clark
> I'm guessing that the problem is that SvRV() is being used without first
> checking that SvROK() is true - ie that there is a valid reference to follow.
Turns out that all the Tie::Hash::NamedCapture routines are similarly
crash-prone, and that a fix is fairly simple, so done in blead as commit
1d021cc8647e49fd860b50abddff99a11b306e2e
Nicholas Clark