Re: Named-capture regex syntax
[p5sagit/p5-mst-13.2.git] / pad.c
diff --git a/pad.c b/pad.c
index 3b52c20..4ff62e2 100644 (file)
--- a/pad.c
+++ b/pad.c
@@ -74,7 +74,7 @@ in PL_op->op_targ), wasting a name SV for them doesn't make sense.
 The SVs in the names AV have their PV being the name of the variable.
 NV+1..IV inclusive is a range of cop_seq numbers for which the name is
 valid.  For typed lexicals name SV is SVt_PVMG and SvSTASH points at the
-type.  For C<our> lexicals, the type is also SVt_PVGV, with the MAGIC slot
+type.  For C<our> lexicals, the type is also SVt_PVMG, with the OURSTASH slot
 pointing at the stash of the associated global (so that duplicate C<our>
 declarations in the same package can be detected).  SvCUR is sometimes
 hijacked to store the generation number during compilation.
@@ -347,6 +347,7 @@ Perl_pad_add_name(pTHX_ const char *name, HV* typestash, HV* ourstash, bool fake
     sv_setpv(namesv, name);
 
     if (typestash) {
+       assert(SvTYPE(namesv) == SVt_PVMG);
        SvPAD_TYPED_on(namesv);
        SvSTASH_set(namesv, (HV*)SvREFCNT_inc_simple_NN((SV*)typestash));
     }