diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2002-05-17 19:03:06 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2002-05-17 19:03:06 +0000 |
commit | 07b8c804e887e8334910292dd4862f56c37dcb00 (patch) | |
tree | 8d3b0ac6d085a8edb2261649d3906d08c697d374 /pp_ctl.c | |
parent | 5afd6d4225c4773e6506b9fc3c8ca61abeea89a5 (diff) | |
download | perl-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.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -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))); |