This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
segfault on &Internals::* due to missing SvROK()
authorÆvar Arnfjörð Bjarmason <avar@cpan.org>
Sat, 11 Sep 2010 09:58:02 +0000 (09:58 +0000)
committerNicholas Clark <nick@ccl4.org>
Sat, 11 Sep 2010 11:23:45 +0000 (12:23 +0100)
commit80b6a949dbabd822cf5e1cf2ece76164d772f0b9
tree66971dc37db0dee1bc6222b441e0a0ed00ea83d6
parent3d8e05a034fc6625a503b87c8ac336d4d84fb338
segfault on &Internals::* due to missing SvROK()

Change the &Internals::* functions that use references in their
prototypes to check if the argument is SvROK() before calling SvRV().

If the function is called as Internals::FOO() perl does this check for
us, but prototypes are bypassed on &Internals::FOO() so we still have
to check this manually.

This fixes [perl #77776], this bug was present in 5.10.x, 5.12.x, and
probably all earlier perl versions that had these functions, but I
haven't tested that.

I'm adding a new test file (t/lib/universal.t) to test universal.c
functions as part of this patch. The testing for Internal::* in t/ was
and is very sparse, but before universal.t there was no obvious place
to put these tests.

Signed-off-by: Ævar Arnfjörð Bjarmason <avar@cpan.org>
MANIFEST
pod/perldelta.pod
t/lib/universal.t [new file with mode: 0644]
universal.c