summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorAlexander Gough <alex-p5p@earth.li>2006-10-19 14:04:12 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-10-19 15:54:15 +0000
commit3c10abe350e3df50f8ef0ac37c9d14175bc899f1 (patch)
tree306a14e8bd8d1b6ebe927f3a074d367f70729e50 /op.c
parentf0ac4cdb6e00777d18589f0326b32a86989110af (diff)
downloadperl-3c10abe350e3df50f8ef0ac37c9d14175bc899f1.tar.gz
stab at UNITCHECK blocks
Message-ID: <20061019120412.GA12290@the.earth.li> p4raw-id: //depot/perl@29053
Diffstat (limited to 'op.c')
-rw-r--r--op.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/op.c b/op.c
index 3dad4882be..66d37349c0 100644
--- a/op.c
+++ b/op.c
@@ -5342,7 +5342,7 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
else
s = tname;
- if (*s != 'B' && *s != 'E' && *s != 'C' && *s != 'I')
+ if (*s != 'B' && *s != 'E' && *s != 'C' && *s != 'I' && *s != 'U')
goto done;
if (strEQ(s, "BEGIN") && !PL_error_count) {
@@ -5370,6 +5370,15 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
av_store(PL_endav, 0, (SV*)cv);
GvCV(gv) = 0; /* cv has been hijacked */
}
+ else if (strEQ(s, "UNITCHECK") && !PL_error_count) {
+ /* It's never too late to run a unitcheck block */
+ if (!PL_unitcheckav)
+ PL_unitcheckav = newAV();
+ DEBUG_x( dump_sub(gv) );
+ av_unshift(PL_unitcheckav, 1);
+ av_store(PL_unitcheckav, 0, (SV*)cv);
+ GvCV(gv) = 0; /* cv has been hijacked */
+ }
else if (strEQ(s, "CHECK") && !PL_error_count) {
if (!PL_checkav)
PL_checkav = newAV();