summaryrefslogtreecommitdiff
path: root/scope.h
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-02-04 04:45:13 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-02-04 04:45:13 +0000
commit354992b151c6d0f4f02b9e65e8ba749a959e700d (patch)
tree128289cffb439d7ecf6f963c11291dd4447397d7 /scope.h
parente194c14e895d209252cde093bbc79234adb5b8de (diff)
downloadperl-354992b151c6d0f4f02b9e65e8ba749a959e700d.tar.gz
fix pad_alloc panic from C<my $w; sub { my($i) = @_; sub { $w } }>
p4raw-id: //depot/perl@4970
Diffstat (limited to 'scope.h')
-rw-r--r--scope.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/scope.h b/scope.h
index f90e7c5f71..fa211996e6 100644
--- a/scope.h
+++ b/scope.h
@@ -31,6 +31,7 @@
#define SAVEt_DESTRUCTOR_X 30
#define SAVEt_VPTR 31
#define SAVEt_I8 32
+#define SAVEt_COMPPAD 33
#define SSCHECK(need) if (PL_savestack_ix + need > PL_savestack_max) savestack_grow()
#define SSPUSHINT(i) (PL_savestack[PL_savestack_ix++].any_i32 = (I32)(i))
@@ -132,6 +133,19 @@ Closing bracket on a callback. See C<ENTER> and L<perlcall>.
} \
} STMT_END
+#define SAVECOMPPAD() \
+ STMT_START { \
+ if (PL_comppad && PL_curpad == AvARRAY(PL_comppad)) { \
+ SSCHECK(2); \
+ SSPUSHPTR((SV*)PL_comppad); \
+ SSPUSHINT(SAVEt_COMPPAD); \
+ } \
+ else { \
+ SAVEVPTR(PL_curpad); \
+ SAVESPTR(PL_comppad); \
+ } \
+ } STMT_END
+
#ifdef USE_ITHREADS
# define SAVECOPSTASH(cop) SAVEPPTR(CopSTASHPV(cop))
# define SAVECOPFILE(cop) SAVEPPTR(CopFILE(cop))