summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-11-04 17:28:29 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-11-04 17:28:29 +0000
commit4f25aa189c4a92535547c706ad37c13b7caee387 (patch)
tree08af6df6000b2bd878b1b2e5e05cd48a1db0464b /op.c
parent0e950d832564d240b1bebd0a01f04f9f5d57cc79 (diff)
downloadperl-4f25aa189c4a92535547c706ad37c13b7caee387.tar.gz
implement STOP blocks and fix compiler to use them (minimally
tested) p4raw-id: //depot/perl@4515
Diffstat (limited to 'op.c')
-rw-r--r--op.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/op.c b/op.c
index cb868a4500..6fd669a7c6 100644
--- a/op.c
+++ b/op.c
@@ -4411,6 +4411,13 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
av_store(PL_endav, 0, (SV *)cv);
GvCV(gv) = 0;
}
+ else if (strEQ(s, "STOP") && !PL_error_count) {
+ if (!PL_stopav)
+ PL_stopav = newAV();
+ av_unshift(PL_stopav, 1);
+ av_store(PL_stopav, 0, (SV *)cv);
+ GvCV(gv) = 0;
+ }
else if (strEQ(s, "INIT") && !PL_error_count) {
if (!PL_initav)
PL_initav = newAV();
@@ -4522,6 +4529,13 @@ Perl_newXS(pTHX_ char *name, XSUBADDR_t subaddr, char *filename)
av_store(PL_endav, 0, (SV *)cv);
GvCV(gv) = 0;
}
+ else if (strEQ(s, "STOP")) {
+ if (!PL_stopav)
+ PL_stopav = newAV();
+ av_unshift(PL_stopav, 1);
+ av_store(PL_stopav, 0, (SV *)cv);
+ GvCV(gv) = 0;
+ }
else if (strEQ(s, "INIT")) {
if (!PL_initav)
PL_initav = newAV();