diff options
author | Hugo van der Sanden <hv@crypt.org> | 2002-09-03 15:34:20 +0100 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-09-04 13:23:17 +0000 |
commit | b8f55b69fbd0df7045f7d14d66b22d94744f42c5 (patch) | |
tree | c2817ea4610fac1417bcfc43093cf54c0b306e97 | |
parent | f531d6eefef19d477e3a272a6e2b1422427ebde0 (diff) | |
download | perl-b8f55b69fbd0df7045f7d14d66b22d94744f42c5.tar.gz |
fix coredump after 64k-deep recursion
Subject: Re: debugging coredump with -DD
Message-Id: <200209031334.g83DYLN09709@crypt.compulink.co.uk>
p4raw-id: //depot/perl@17835
-rw-r--r-- | cop.h | 4 | ||||
-rwxr-xr-x | t/op/recurse.t | 11 |
2 files changed, 9 insertions, 6 deletions
@@ -111,7 +111,7 @@ struct block_sub { AV * savearray; #endif /* USE_5005THREADS */ AV * argarray; - U16 olddepth; + long olddepth; U8 hasargs; U8 lval; /* XXX merge lval and hasargs? */ SV ** oldcurpad; @@ -119,7 +119,7 @@ struct block_sub { #define PUSHSUB(cx) \ cx->blk_sub.cv = cv; \ - cx->blk_sub.olddepth = (U16)CvDEPTH(cv); \ + cx->blk_sub.olddepth = CvDEPTH(cv); \ cx->blk_sub.hasargs = hasargs; \ cx->blk_sub.lval = PL_op->op_private & \ (OPpLVAL_INTRO|OPpENTERSUB_INARGS); diff --git a/t/op/recurse.t b/t/op/recurse.t index 374813c9e4..9d0064068b 100755 --- a/t/op/recurse.t +++ b/t/op/recurse.t @@ -8,7 +8,7 @@ BEGIN { chdir 't' if -d 't'; @INC = qw(. ../lib); require "test.pl"; - plan(tests => 26); + plan(tests => 28); } use strict; @@ -112,6 +112,9 @@ is(takeuchi($x, $y, $z), $z + 1, "takeuchi($x, $y, $z) == $z + 1"); is(sillysum(1000), 1000*1001/2, "recursive sum of 1..1000"); } - - - +# check ok for recursion depth > 65536 +is(runperl( + nolib => 1, + prog => q{$d=0; $e=1; sub c { ++$d; if ($d > 66000) { $e=0 } else { c(); c() unless $d % 32768 } --$d } c(); exit $e}, +), '', "64K deep recursion - no output expected"); +is($?, 0, "64K deep recursion - no coredump expected"); |