This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix-ups for Attribute::Handlers
[perl5.git] / pp.c
diff --git a/pp.c b/pp.c
index 723986c..ea05bb4 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -249,6 +249,7 @@ S_rv2gv(pTHX_ SV *sv, const bool vivify_sv, const bool strict,
                        const char * const name = CopSTASHPV(PL_curcop);
                        gv = newGVgen_flags(name,
                                 HvNAMEUTF8(CopSTASH(PL_curcop)) ? SVf_UTF8 : 0 );
+                       SvREFCNT_inc_simple_void_NN(gv);
                    }
                    prepare_SV_for_RV(sv);
                    SvRV_set(sv, MUTABLE_SV(gv));
@@ -471,7 +472,9 @@ PP(pp_rv2cv)
     CV *cv = sv_2cv(TOPs, &stash_unused, &gv, flags);
     if (cv) NOOP;
     else if ((flags == (GV_ADD|GV_NOEXPAND)) && gv && SvROK(gv)) {
-       cv = MUTABLE_CV(gv);
+       cv = SvTYPE(SvRV(gv)) == SVt_PVCV
+           ? MUTABLE_CV(SvRV(gv))
+           : MUTABLE_CV(gv);
     }    
     else
        cv = MUTABLE_CV(&PL_sv_undef);
@@ -2703,7 +2706,7 @@ PP(pp_sin)
     {
       SV * const arg = POPs;
       const NV value = SvNV_nomg(arg);
-      NV result;
+      NV result = NV_NAN;
       if (neg_report) { /* log or sqrt */
          if (op_type == OP_LOG ? (value <= 0.0) : (value < 0.0)) {
              SET_NUMERIC_STANDARD();
@@ -2712,6 +2715,7 @@ PP(pp_sin)
          }
       }
       switch (op_type) {
+      default:
       case OP_SIN:  result = Perl_sin(value);  break;
       case OP_COS:  result = Perl_cos(value);  break;
       case OP_EXP:  result = Perl_exp(value);  break;