summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorChip Salzenberg <chip@perl.com>1997-02-11 10:11:59 +1200
committerChip Salzenberg <chip@atlantic.net>1997-02-18 13:22:00 +1200
commit15ff848f77796a7eb1aa7d49b2bc68dd9e9c24f9 (patch)
tree10c6528a382988bd59ab4cc7a73eac9d660e2391 /pp_hot.c
parent9d17b0a6244cecb9ba7d42c6a1a882fd933f6f45 (diff)
downloadperl-15ff848f77796a7eb1aa7d49b2bc68dd9e9c24f9.tar.gz
Fix sub call through magic var (e.g. C<&$1>)
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 16c250593e..44981b746f 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1706,9 +1706,14 @@ PP(pp_entersub)
if (sv == &sv_yes) /* unfound import, ignore */
RETURN;
- if (!SvOK(sv))
+ if (SvGMAGICAL(sv)) {
+ mg_get(sv);
+ sym = SvPOKp(sv) ? SvPVX(sv) : Nullch;
+ }
+ else
+ sym = SvPV(sv, na);
+ if (!sym)
DIE(no_usym, "a subroutine");
- sym = SvPV(sv,na);
if (op->op_private & HINT_STRICT_REFS)
DIE(no_symref, sym, "a subroutine");
cv = perl_get_cv(sym, TRUE);