summaryrefslogtreecommitdiff
path: root/cop.h
diff options
context:
space:
mode:
Diffstat (limited to 'cop.h')
-rw-r--r--cop.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/cop.h b/cop.h
index 14cd43e3c0..d450e09b01 100644
--- a/cop.h
+++ b/cop.h
@@ -49,9 +49,13 @@ struct block_sub {
/* We muck with cxstack_ix since _dec may call a DESTROY, overwriting cx. */
#define POPSUB(cx) \
- if (cx->blk_sub.hasargs) { /* put back old @_ */ \
+ if (cx->blk_sub.hasargs) { \
+ /* put back old @_ */ \
SvREFCNT_dec(GvAV(defgv)); \
GvAV(defgv) = cx->blk_sub.savearray; \
+ /* destroy arg array */ \
+ av_clear(cx->blk_sub.argarray); \
+ AvREAL_off(cx->blk_sub.argarray); \
} \
if (cx->blk_sub.cv) { \
if (!(CvDEPTH(cx->blk_sub.cv) = cx->blk_sub.olddepth)) { \