summaryrefslogtreecommitdiff
path: root/cop.h
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-07-17 13:35:51 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-07-17 13:35:51 +0000
commit6d4ff0d2f86d3c242b3f29bee3c2734df9ab8a3a (patch)
tree214aad99b5b3c414ccc9a349a7aacbdda3b96649 /cop.h
parentc03294656c9980c235cc5951a63088fd96d33704 (diff)
downloadperl-6d4ff0d2f86d3c242b3f29bee3c2734df9ab8a3a.tar.gz
Fix multiple problems with lexical @_.
p4raw-id: //depot/perl@39
Diffstat (limited to 'cop.h')
-rw-r--r--cop.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/cop.h b/cop.h
index baedc5a52d..f49bfaf77a 100644
--- a/cop.h
+++ b/cop.h
@@ -28,7 +28,9 @@ struct block_sub {
CV * cv;
GV * gv;
GV * dfoutgv;
+#ifndef USE_THREADS
AV * savearray;
+#endif /* USE_THREADS */
AV * argarray;
U16 olddepth;
U8 hasargs;
@@ -54,11 +56,19 @@ struct block_sub {
#define POPSUB1(cx) \
cxsub = cx->blk_sub; /* because DESTROY may clobber *cx */
+#ifdef USE_THREADS
+#define POPSAVEARRAY() NOOP
+#else
+#define POPSAVEARRAY() \
+ STMT_START { \
+ SvREFCNT_dec(GvAV(defgv)); \
+ GvAV(defgv) = cxsub.savearray; \
+ } STMT_END
+#endif /* USE_THREADS */
+
#define POPSUB2() \
if (cxsub.hasargs) { \
- /* put back old @_ */ \
- SvREFCNT_dec(GvAV(defgv)); \
- GvAV(defgv) = cxsub.savearray; \
+ POPSAVEARRAY(); \
/* destroy arg array */ \
av_clear(cxsub.argarray); \
AvREAL_off(cxsub.argarray); \