cvs commit: ponie/src/pmc perl5cargo_cult.pmc
[email protected] (Nicholas Clark) 15 Oct 2004 23:04:42 -0000
| Newsgroups | perl.ponie.changes |
|---|---|
| Message-ID | <[email protected]> |
cvsuser 04/10/15 16:04:42
Modified: perl pad.c sv.h
src/pmc perl5cargo_cult.pmc
Log:
Add PADTYPED and PADOUR to PMC
Revision Changes Path
1.2 +14 -5 ponie/perl/pad.c
Index: pad.c
===================================================================
RCS file: /cvs/public/ponie/perl/pad.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -r1.1 -r1.2
--- pad.c 9 Sep 2003 11:58:51 -0000 1.1
+++ pad.c 15 Oct 2004 23:04:41 -0000 1.2
@@ -1,6 +1,6 @@
/* pad.c
*
- * Copyright (C) 2002,2003 by Larry Wall and others
+ * Copyright (C) 2002, 2003, 2004, by Larry Wall and others
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
@@ -91,6 +91,12 @@
Note that formats are treated as anon subs, and are cloned each time
write is called (if necessary).
+The flag SVf_PADSTALE is cleared on lexicals each time the my() is executed,
+and set on scope exit. This allows the 'Variable $x is not available' warning
+to be generated in evals, such as
+
+ { my $x = 1; sub f { eval '$x'} } f();
+
=cut
*/
@@ -251,8 +257,11 @@
CV *innercv = (CV*)curpad[ix];
namepad[ix] = Nullsv;
SvREFCNT_dec(namesv);
+
+ if (SvREFCNT(comppad) < 2) { /* allow for /(?{ sub{} })/ */
curpad[ix] = Nullsv;
SvREFCNT_dec(innercv);
+ }
if (SvREFCNT(innercv) /* in use, not just a prototype */
&& CvOUTSIDE(innercv) == cv)
{
@@ -322,11 +331,11 @@
sv_setpv(namesv, name);
if (typestash) {
- SvFLAGS(namesv) |= SVpad_TYPED;
+ SvPADTYPED_on(namesv);
SvSTASH(namesv) = (HV*)SvREFCNT_inc((SV*) typestash);
}
if (ourstash) {
- SvFLAGS(namesv) |= SVpad_OUR;
+ SvPADOUR_on(namesv);
GvSTASH(namesv) = (HV*)SvREFCNT_inc((SV*) ourstash);
}
1.46 +5 -0 ponie/perl/sv.h
Index: sv.h
===================================================================
RCS file: /cvs/public/ponie/perl/sv.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -w -r1.45 -r1.46
--- sv.h 15 Oct 2004 22:13:31 -0000 1.45
+++ sv.h 15 Oct 2004 23:04:41 -0000 1.46
@@ -231,6 +231,8 @@
Ponie_I_SV_PADSTALE,
Ponie_I_SV_PADTMP,
Ponie_I_SV_PADMY,
+ Ponie_I_SV_PADTYPED,
+ Ponie_I_SV_PADOUR,
Ponie_I_SV_TEMP,
Ponie_I_SV_OBJECT,
Ponie_I_SV_READONLY,
@@ -748,6 +750,9 @@
#define SvPADMY(sv) ((U32)Parrot_PMC_get_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_PADMY))
#define SvPADMY_on(sv) Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_PADMY, 1)
+#define SvPADTYPED_on(sv) Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_PADTYPED, 1)
+#define SvPADOUR_on(sv) Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_PADOUR, 1)
+
#define SvTEMP(sv) ((U32)Parrot_PMC_get_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_TEMP))
#define SvTEMP_on(sv) Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_TEMP, 1)
#define SvTEMP_off(sv) Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_TEMP, 0)
1.35 +13 -1 ponie/src/pmc/perl5cargo_cult.pmc
Index: perl5cargo_cult.pmc
===================================================================
RCS file: /cvs/public/ponie/src/pmc/perl5cargo_cult.pmc,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -w -r1.34 -r1.35
--- perl5cargo_cult.pmc 15 Oct 2004 22:13:31 -0000 1.34
+++ perl5cargo_cult.pmc 15 Oct 2004 23:04:42 -0000 1.35
@@ -1,7 +1,7 @@
/* Perl5QQQ.pmc -*- c -*-
* Copyright: 2001-2004 The Perl Foundation. All Rights Reserved.
* CVS Info
- * $Id: perl5cargo_cult.pmc,v 1.34 2004/10/15 22:13:31 nicholas Exp $
+ * $Id: perl5cargo_cult.pmc,v 1.35 2004/10/15 23:04:42 nicholas Exp $
* Overview:
* These are the vtable functions for the Perl5QQQ base class
* Data Structure and Algorithms:
@@ -543,6 +543,18 @@
|= SVs_PADMY;
return;
}
+ case Ponie_I_SV_PADTYPED:
+ if (value) {
+ (((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags)
+ |= SVpad_TYPED;
+ return;
+ }
+ case Ponie_I_SV_PADOUR:
+ if (value) {
+ (((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags)
+ |= SVpad_OUR;
+ return;
+ }
case Ponie_I_SV_TEMP:
if (value) {
(((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags)