This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
SAVEt_CLEARSV: expand SvOK_off() macro
authorDavid Mitchell <davem@iabyn.com>
Fri, 28 Feb 2014 18:35:02 +0000 (18:35 +0000)
committerDavid Mitchell <davem@iabyn.com>
Fri, 28 Feb 2014 19:38:44 +0000 (19:38 +0000)
the next commit will change thinks that affect only part of the macro

scope.c

diff --git a/scope.c b/scope.c
index 23ade78..6bef7b0 100644 (file)
--- a/scope.c
+++ b/scope.c
@@ -1090,7 +1090,11 @@ Perl_leave_scope(pTHX_ I32 base)
                         break;
                     }
                     default:
-                        SvOK_off(sv);
+                        assert_not_ROK(sv);
+                        assert_not_glob(sv);
+                        SvFLAGS(sv) &=~ (SVf_OK|SVf_IVisUV|SVf_UTF8);
+                        if (SvOOK(sv))
+                            sv_backoff(sv);
                         break;
                     }
                     SvPADSTALE_on(sv); /* mark as no longer live */