diff options
author | Tony Cook <tony@develop-help.com> | 2013-09-11 09:40:11 +1000 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2013-09-11 09:40:11 +1000 |
commit | 0e903f68eeabc5e9f46bbbbf12dcd48433d004ce (patch) | |
tree | c6a89286c951120516edc732829f231cc430fd5b | |
parent | 26ae0e4f068a4c6f991e497b5cb0e3e90ded981a (diff) | |
download | perl-0e903f68eeabc5e9f46bbbbf12dcd48433d004ce.tar.gz |
[perl #119351] fix B::CV::GV to return a B::SPECIAL on NULL
Cherry pick of
31d073689e2b5fa63aa7d4f8aaf529f75eeb5d0e
5f7c1602dfa694a4a6761e9e4fc077ce794f7ff0
f244b085582eaec9f2cf7bfabeb686bf74167bf6
combined with a version bump.
-rw-r--r-- | ext/B/B.pm | 2 | ||||
-rw-r--r-- | ext/B/B.xs | 5 | ||||
-rw-r--r-- | ext/B/t/b.t | 2 |
3 files changed, 3 insertions, 6 deletions
diff --git a/ext/B/B.pm b/ext/B/B.pm index bd2cf66b62..881b68b4e0 100644 --- a/ext/B/B.pm +++ b/ext/B/B.pm @@ -15,7 +15,7 @@ require Exporter; # walkoptree comes from B.xs BEGIN { - $B::VERSION = '1.42_01'; + $B::VERSION = '1.42_02'; @B::EXPORT_OK = (); # Our BOOT code needs $VERSION set, and will append to @EXPORT_OK. diff --git a/ext/B/B.xs b/ext/B/B.xs index d1ca38c5f0..142a485bd8 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -1875,11 +1875,8 @@ const_sv(cv) void GV(cv) B::CV cv - PREINIT: - GV *gv; CODE: - gv = CvGV(cv); - ST(0) = gv ? make_sv_object(aTHX_ (SV*)gv) : &PL_sv_undef; + ST(0) = make_sv_object(aTHX_ (SV*)CvGV(cv)); #if PERL_VERSION > 17 diff --git a/ext/B/t/b.t b/ext/B/t/b.t index d58d2e06f0..cbf9e1f862 100644 --- a/ext/B/t/b.t +++ b/ext/B/t/b.t @@ -405,7 +405,7 @@ SKIP: ok($cv, "make a B::CV from a lexical sub reference"); isa_ok($cv, "B::CV"); my $gv = $cv->GV; - is($gv, undef, "GV on a lexical sub is NULL"); + isa_ok($gv, "B::SPECIAL", "GV on a lexical sub"); my $hek = $cv->NAME_HEK; is($hek, "bar", "check the NAME_HEK"); } |