This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Storable: switch to using SvPVCLEAR()
authorYves Orton <demerphq@gmail.com>
Wed, 19 Oct 2016 08:55:40 +0000 (10:55 +0200)
committerYves Orton <demerphq@gmail.com>
Wed, 19 Oct 2016 11:28:00 +0000 (13:28 +0200)
dist/Storable/Storable.xs

index a5f8ecd..053951c 100644 (file)
@@ -4894,7 +4894,7 @@ static SV *retrieve_lscalar(pTHX_ stcxt_t *cxt, const char *cname)
        SEEN_NN(sv, stash, 0);  /* Associate this new scalar with tag "tagnum" */
 
        if (len ==  0) {
-           sv_setpvs(sv, "");
+           SvPVCLEAR(sv);
            return sv;
        }
 
@@ -5684,7 +5684,7 @@ static SV *retrieve_code(pTHX_ stcxt_t *cxt, const char *cname)
        SAVETMPS;
 
        errsv = get_sv("@", GV_ADD);
-       sv_setpvs(errsv, "");   /* clear $@ */
+       SvPVCLEAR(errsv);       /* clear $@ */
        if (SvROK(cxt->eval) && SvTYPE(SvRV(cxt->eval)) == SVt_PVCV) {
                PUSHMARK(sp);
                XPUSHs(sv_2mortal(newSVsv(sub)));