summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-02-07 17:51:06 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-02-07 17:51:06 +0000
commit97a302248148408e070f6d0f05512ccda315b31c (patch)
tree2c9bf4434f0ca023ae5c3d6dbc96394e55e809ca /gnu/usr.bin/perl
parente7559391d619dd0614176fb1ee0aba349a7a6726 (diff)
Change 6214 by gsar@auger on 2000/06/08 13:57:54
@_ can't have junk in it even in the non-USE_ITHREADS case because caller() wants to populate @DB::args with it (causes a coredump in Carp::confess())
Diffstat (limited to 'gnu/usr.bin/perl')
-rw-r--r--gnu/usr.bin/perl/cop.h10
-rw-r--r--gnu/usr.bin/perl/patchlevel.h1
-rw-r--r--gnu/usr.bin/perl/t/op/runlevel.t15
3 files changed, 19 insertions, 7 deletions
diff --git a/gnu/usr.bin/perl/cop.h b/gnu/usr.bin/perl/cop.h
index e588675012a..2b9ddf49129 100644
--- a/gnu/usr.bin/perl/cop.h
+++ b/gnu/usr.bin/perl/cop.h
@@ -105,13 +105,9 @@ struct block_sub {
} STMT_END
#endif /* USE_THREADS */
-#ifdef USE_ITHREADS
- /* junk in @_ spells trouble when cloning CVs, so don't leave any */
-# define CLEAR_ARGARRAY() av_clear(cx->blk_sub.argarray)
-#else
-# define CLEAR_ARGARRAY() NOOP
-#endif /* USE_ITHREADS */
-
+/* junk in @_ spells trouble when cloning CVs and in pp_caller(), so don't
+ * leave any */
+#define CLEAR_ARGARRAY() av_clear(cx->blk_sub.argarray)
#define POPSUB(cx,sv) \
STMT_START { \
diff --git a/gnu/usr.bin/perl/patchlevel.h b/gnu/usr.bin/perl/patchlevel.h
index 645620d799b..e98313b3f73 100644
--- a/gnu/usr.bin/perl/patchlevel.h
+++ b/gnu/usr.bin/perl/patchlevel.h
@@ -71,6 +71,7 @@
static char *local_patches[] = {
NULL
,"SUIDMAIL - fixes for suidperl security"
+ ,"CHANGE6214 - fixes a coredump in @DB::args"
,NULL
};
diff --git a/gnu/usr.bin/perl/t/op/runlevel.t b/gnu/usr.bin/perl/t/op/runlevel.t
index e988ad9362a..3865e52070d 100644
--- a/gnu/usr.bin/perl/t/op/runlevel.t
+++ b/gnu/usr.bin/perl/t/op/runlevel.t
@@ -349,3 +349,18 @@ A 1
bar
B 2
bar
+########
+sub n { 0 }
+sub f { my $x = shift; d(); }
+f(n());
+f();
+
+sub d {
+ my $i = 0; my @a;
+ while (do { { package DB; @a = caller($i++) } } ) {
+ @a = @DB::args;
+ for (@a) { print "$_\n"; $_ = '' }
+ }
+}
+EXPECT
+0