summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorglasser@tang-eleven-seventy-nine.mit.edu <glasser@tang-eleven-seventy-nine.mit.edu>2005-04-20 19:28:14 +0000
committerDave Mitchell <davem@fdisolutions.com>2005-04-20 21:47:40 +0000
commitf2a7f2982c10dbcfc2084d281af6ad8b959d5fb9 (patch)
treea7074d1d39356ac19f8d88c5f86c5bd529a64384 /pp_ctl.c
parent4944113acaf494b4518ba93648e0a4276c34a175 (diff)
downloadperl-f2a7f2982c10dbcfc2084d281af6ad8b959d5fb9.tar.gz
[perl #35059] [PATCH] caller() skips frames (such as eval() frames) if $^P set
From: glasser@tang-eleven-seventy-nine.mit.edu (via RT) <perlbug-followup@perl.org> Message-Id: <rt-3.0.11-35059-111134.0.304511316819145@perl.org> improved version of change 21842 that copes with glob DB::sub existing but &DB::sub not existing. p4raw-id: //depot/perl@24265
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 5ce91730bd..79c38f0805 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1567,7 +1567,8 @@ PP(pp_caller)
}
RETURN;
}
- if (PL_DBsub && cxix >= 0 &&
+ /* caller() should not report the automatic calls to &DB::sub */
+ if (PL_DBsub && GvCV(PL_DBsub) && cxix >= 0 &&
ccstack[cxix].blk_sub.cv == GvCV(PL_DBsub))
count++;
if (!count--)
@@ -1580,7 +1581,8 @@ PP(pp_caller)
dbcxix = dopoptosub_at(ccstack, cxix - 1);
/* We expect that ccstack[dbcxix] is CXt_SUB, anyway, the
field below is defined for any cx. */
- if (PL_DBsub && dbcxix >= 0 && ccstack[dbcxix].blk_sub.cv == GvCV(PL_DBsub))
+ /* caller() should not report the automatic calls to &DB::sub */
+ if (PL_DBsub && GvCV(PL_DBsub) && dbcxix >= 0 && ccstack[dbcxix].blk_sub.cv == GvCV(PL_DBsub))
cx = &ccstack[dbcxix];
}