Change 33302 by [EMAIL PROTECTED] on 2008/02/13 18:39:50

        Subject: [perl #47047] Use of inherited AUTOLOAD for non-method is 
deprecated 
        From: Rick Delaney (via RT) <[EMAIL PROTECTED]>
        Date: Tue, 30 Oct 2007 20:19:40 -0700
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/pp_hot.c#569 edit
... //depot/perl/t/lib/warnings/gv#8 edit

Differences ...

==== //depot/perl/pp_hot.c#569 (text) ====
Index: perl/pp_hot.c
--- perl/pp_hot.c#568~33291~    2008-02-12 05:15:20.000000000 -0800
+++ perl/pp_hot.c       2008-02-13 10:39:50.000000000 -0800
@@ -2735,9 +2735,14 @@
        }
        /* should call AUTOLOAD now? */
        else {
-try_autoload:
+try_autoload: 
+         {
+           const bool is_method = cLISTOP->op_last &&
+               (cLISTOP->op_last->op_type == OP_METHOD_NAMED ||
+                cLISTOP->op_last->op_type == OP_METHOD);
+
            if ((autogv = gv_autoload4(GvSTASH(gv), GvNAME(gv), GvNAMELEN(gv),
-                                  FALSE)))
+                                  is_method)))
            {
                cv = GvCV(autogv);
            }
@@ -2747,6 +2752,7 @@
                gv_efullname3(sub_name, gv, NULL);
                DIE(aTHX_ "Undefined subroutine &%"SVf" called", 
SVfARG(sub_name));
            }
+         }
        }
        if (!cv)
            DIE(aTHX_ "Not a CODE reference");

==== //depot/perl/t/lib/warnings/gv#8 (text) ====
Index: perl/t/lib/warnings/gv
--- perl/t/lib/warnings/gv#7~31589~     2007-07-11 12:31:40.000000000 -0700
+++ perl/t/lib/warnings/gv      2008-02-13 10:39:50.000000000 -0800
@@ -39,6 +39,8 @@
 @ISA = qw(Other) ;
 use warnings 'deprecated' ;
 fred() ;
+my $x = \&barney;
+(bless[])->barney;
 EXPECT
 Use of inherited AUTOLOAD for non-method main::fred() is deprecated at - line 
5.
 ########
End of Patch.

Reply via email to