summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-07-11 17:57:48 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-07-11 17:57:48 +0000
commit60ed1d8c6a1833ad712cafbcb926be21a03df470 (patch)
tree34088dc4a27bacd6ada9486934679bd7446614c4 /op.c
parenta9419b5523cf55175503760dcfdf0b3775a2952c (diff)
downloadperl-60ed1d8c6a1833ad712cafbcb926be21a03df470.tar.gz
integrate cfgperl changes#6224..6229 into mainline
p4raw-link: @6229 on //depot/cfgperl: 94f13a8fe911b4e5d658c1e8bb515599305c074c p4raw-link: @6224 on //depot/cfgperl: 9e7db0fd3029ee5d3ce957e842a66c057eacd303 p4raw-id: //depot/perl@6352 p4raw-deleted: from //depot/cfgperl@6351 'delete in' lib/lib.pm (@5608..) p4raw-integrated: from //depot/cfgperl@6351 'copy in' t/lib/english.t (@5586..) ext/Socket/Socket.pm (@5704..) README.hpux (@5972..) lib/English.pm (@6034..) p4raw-integrated: from //depot/cfgperl@6228 'copy in' op.c (@6226..) p4raw-branched: from //depot/cfgperl@6227 'branch in' lib/lib.pm.PL p4raw-integrated: from //depot/cfgperl@6227 'copy in' Makefile.SH (@6182..) MANIFEST (@6192..) p4raw-integrated: from //depot/cfgperl@6225 'merge in' embed.pl (@6221..)
Diffstat (limited to 'op.c')
-rw-r--r--op.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/op.c b/op.c
index d70f0d51f8..fb060d3052 100644
--- a/op.c
+++ b/op.c
@@ -4431,9 +4431,15 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
if (!name || GvCVGEN(gv))
cv = Nullcv;
else if ((cv = GvCV(gv))) {
- cv_ckproto(cv, gv, ps);
+ bool exists = CvROOT(cv) || CvXSUB(cv);
+ /* if the subroutine doesn't exist and wasn't pre-declared
+ * with a prototype, assume it will be AUTOLOADed,
+ * skipping the prototype check
+ */
+ if (exists || SvPOK(cv))
+ cv_ckproto(cv, gv, ps);
/* already defined (or promised)? */
- if (CvROOT(cv) || CvXSUB(cv) || GvASSUMECV(gv)) {
+ if (exists || GvASSUMECV(gv)) {
SV* const_sv;
bool const_changed = TRUE;
if (!block && !attrs) {
@@ -4448,7 +4454,7 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
goto withattrs;
if ((const_sv = cv_const_sv(cv)))
const_changed = sv_cmp(const_sv, op_const_sv(block, Nullcv));
- if ((const_sv || const_changed) && ckWARN(WARN_REDEFINE))
+ if ((const_sv && const_changed) || ckWARN(WARN_REDEFINE))
{
line_t oldline = CopLINE(PL_curcop);
CopLINE_set(PL_curcop, PL_copline);