diff options
author | Tony Cook <tony@develop-help.com> | 2019-02-28 11:53:19 +1100 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2019-03-08 10:36:13 +1100 |
commit | bf3e41ff5d42bd65e92e06ce1b1b8f24064a178a (patch) | |
tree | 3e41166fd7c6c944d4cd236674a4599f8d038000 /lib/perl5db.pl | |
parent | 500ca7737cc8454aecbe706ae402a2d77cae1b25 (diff) | |
download | perl-bf3e41ff5d42bd65e92e06ce1b1b8f24064a178a.tar.gz |
(perl #124203) fix a similar problem with DB::lsub
Diffstat (limited to 'lib/perl5db.pl')
-rw-r--r-- | lib/perl5db.pl | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/lib/perl5db.pl b/lib/perl5db.pl index be2367cde7..e8a29da134 100644 --- a/lib/perl5db.pl +++ b/lib/perl5db.pl @@ -4281,25 +4281,6 @@ sub DB::sub { sub lsub : lvalue { - no strict 'refs'; - - # lock ourselves under threads - lock($DBGR); - - # Whether or not the autoloader was running, a scalar to put the - # sub's return value in (if needed), and an array to put the sub's - # return value in (if needed). - my ( $al, $ret, @ret ) = ""; - if ($sub =~ /^threads::new$/ && $ENV{PERL5DB_THREADED}) { - print "creating new thread\n"; - } - - # If the last ten characters are C'::AUTOLOAD', note we've traced - # into AUTOLOAD for $sub. - if ( length($sub) > 10 && substr( $sub, -10, 10 ) eq '::AUTOLOAD' ) { - $al = " for $$sub"; - } - # We stack the stack pointer and then increment it to protect us # from a situation that might unwind a whole bunch of call frames # at once. Localizing the stack pointer means that it will automatically @@ -4317,12 +4298,32 @@ sub lsub : lvalue { # stack for us. local $single = $single & 1; - # If we've gotten really deeply recursed, turn on the flag that will - # make us stop with the 'deep recursion' message. - $single |= 4 if $stack_depth == $deep; + no strict 'refs'; + { + # lock ourselves under threads + lock($DBGR); + + # Whether or not the autoloader was running, a scalar to put the + # sub's return value in (if needed), and an array to put the sub's + # return value in (if needed). + my ( $al, $ret, @ret ) = ""; + if ($sub =~ /^threads::new$/ && $ENV{PERL5DB_THREADED}) { + print "creating new thread\n"; + } + + # If the last ten characters are C'::AUTOLOAD', note we've traced + # into AUTOLOAD for $sub. + if ( length($sub) > 10 && substr( $sub, -10, 10 ) eq '::AUTOLOAD' ) { + $al = " for $$sub"; + } - # If frame messages are on ... - _print_frame_message($al); + # If we've gotten really deeply recursed, turn on the flag that will + # make us stop with the 'deep recursion' message. + $single |= 4 if $stack_depth == $deep; + + # If frame messages are on ... + _print_frame_message($al); + } # call the original lvalue sub. &$sub; |