summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-05-17 19:03:06 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-05-17 19:03:06 +0000
commit07b8c804e887e8334910292dd4862f56c37dcb00 (patch)
tree8d3b0ac6d085a8edb2261649d3906d08c697d374 /pp_ctl.c
parent5afd6d4225c4773e6506b9fc3c8ca61abeea89a5 (diff)
downloadperl-07b8c804e887e8334910292dd4862f56c37dcb00.tar.gz
Fix bug 20020517.003 : segfault with caller().
Add regression tests for caller. p4raw-id: //depot/perl@16658
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index d46187379b..8432a15871 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1450,11 +1450,18 @@ PP(pp_caller)
if (!MAXARG)
RETURN;
if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT) {
+ GV *cvgv = CvGV(ccstack[cxix].blk_sub.cv);
/* So is ccstack[dbcxix]. */
- sv = NEWSV(49, 0);
- gv_efullname3(sv, CvGV(ccstack[cxix].blk_sub.cv), Nullch);
- PUSHs(sv_2mortal(sv));
- PUSHs(sv_2mortal(newSViv((I32)cx->blk_sub.hasargs)));
+ if (isGV(cvgv)) {
+ sv = NEWSV(49, 0);
+ gv_efullname3(sv, cvgv, Nullch);
+ PUSHs(sv_2mortal(sv));
+ PUSHs(sv_2mortal(newSViv((I32)cx->blk_sub.hasargs)));
+ }
+ else {
+ PUSHs(sv_2mortal(newSVpvn("(unknown)",9)));
+ PUSHs(sv_2mortal(newSViv(0)));
+ }
}
else {
PUSHs(sv_2mortal(newSVpvn("(eval)",6)));