summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/pp_hot.c b/pp_hot.c
index cd1a885f67..61324bfc80 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2735,9 +2735,14 @@ PP(pp_entersub)
}
/* 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 @@ try_autoload:
gv_efullname3(sub_name, gv, NULL);
DIE(aTHX_ "Undefined subroutine &%"SVf" called", SVfARG(sub_name));
}
+ }
}
if (!cv)
DIE(aTHX_ "Not a CODE reference");