This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #119351] fix B::CV::GV to return a B::SPECIAL on NULL
authorTony Cook <tony@develop-help.com>
Wed, 21 Aug 2013 23:38:24 +0000 (09:38 +1000)
committerTony Cook <tony@develop-help.com>
Sun, 25 Aug 2013 22:43:50 +0000 (08:43 +1000)
ext/B/B.xs
ext/B/t/b.t

index 23e7620..62496e2 100644 (file)
@@ -1896,11 +1896,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
 
index d58d2e0..f1763b4 100644 (file)
@@ -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 is NULL");
         my $hek = $cv->NAME_HEK;
         is($hek, "bar", "check the NAME_HEK");
     }