Skip to content

Commit

Permalink
[perl #48489] patch to fix perl bug #7013
Browse files Browse the repository at this point in the history
From: "bharanee rathna" (via RT) <perlbug-followup@perl.org>
Message-ID: <rt-3.6.HEAD-28750-1197415521-1978.48489-75-0@perl.org>

Just the pp_hot.c portion of this patch applied along with removing
the TODO from the test added in the previous change.

p4raw-id: //depot/perl@34833
  • Loading branch information
bharanee rathna authored and smpeters committed Nov 14, 2008
1 parent 6fd69bb commit 1ad62f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/perl5db.t
Expand Up @@ -76,9 +76,8 @@ like($contents, qr/sub factorial/,
'The ${main::_<filename} variable in the debugger was not destroyed'
);

TODO: {
{
local $ENV{PERLDB_OPTS} = "ReadLine=0";
local $::TODO = "lvalueness isn't propagated in the debugger";
my $output = runperl(switches => [ '-d' ], progfile => '../lib/perl5db/t/lvalue-bug');
like($output, qr/foo is defined/, 'lvalue subs work in the debugger');
}
Expand Down
9 changes: 8 additions & 1 deletion pp_hot.c
Expand Up @@ -2774,7 +2774,14 @@ PP(pp_entersub)
Perl_get_db_sub(aTHX_ &sv, cv);
if (CvISXSUB(cv))
PL_curcopdb = PL_curcop;
cv = GvCV(PL_DBsub);
if (CvLVALUE(cv)) {
/* check for lsub that handles lvalue subroutines */
cv = GvCV(gv_HVadd(gv_fetchpv("DB::lsub", GV_ADDMULTI, SVt_PVHV)));
/* if lsub not found then fall back to DB::sub */
if (!cv) cv = GvCV(PL_DBsub);
} else {
cv = GvCV(PL_DBsub);
}

if (!cv || (!CvXSUB(cv) && !CvSTART(cv)))
DIE(aTHX_ "No DB::sub routine defined");
Expand Down

0 comments on commit 1ad62f6

Please sign in to comment.