summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-05-26 06:00:01 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-06-07 08:18:53 -0700
commit6954f42f948dcf1dba2014aa06dd5c33b7561992 (patch)
treeae3709c7181f41b050a51cd1f510ab5b9556ac6e /pp.c
parentbf3d870f8b8accd379ab520c1ff1daa10317d27d (diff)
downloadperl-6954f42f948dcf1dba2014aa06dd5c33b7561992.tar.gz
Make prototype call FETCH before checking CORE:: prefix
$ perl5.16.0 -e '"CORE::length" =~ /(.*)/; warn prototype $1;' Warning: something's wrong at -e line 1. $ perl5.16.0 -e 'warn prototype "CORE::length"' _ at -e line 1. Since sv_2cv calls get-magic, the easiest solution is to copy the argument if it is magical.
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/pp.c b/pp.c
index 8d2ee2a935..0370caa27b 100644
--- a/pp.c
+++ b/pp.c
@@ -432,6 +432,7 @@ PP(pp_prototype)
GV *gv;
SV *ret = &PL_sv_undef;
+ if (SvGMAGICAL(TOPs)) SETs(sv_mortalcopy(TOPs));
if (SvPOK(TOPs) && SvCUR(TOPs) >= 7) {
const char * s = SvPVX_const(TOPs);
if (strnEQ(s, "CORE::", 6)) {