summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorVincent Pit <perl@profvince.com>2008-04-30 15:14:00 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2008-04-30 11:51:12 +0000
commita91d1d4276ac73a4692bb4f0f5725c1b2817cfa8 (patch)
treef4fb6f4f23f63d003f9624a6b00dc8fa0b25192b /pp_sys.c
parent4dafff080a0de2a23b8e599ab8105c372ed372f8 (diff)
downloadperl-a91d1d4276ac73a4692bb4f0f5725c1b2817cfa8.tar.gz
Double magic/warnings with tie $x, $m
From: "Vincent Pit" <perl@profvince.com> Message-ID: <62186.92.128.43.82.1209554040.squirrel@92.128.43.82> p4raw-id: //depot/perl@33770
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 94549ed48d..833e5656af 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -825,7 +825,7 @@ PP(pp_tie)
break;
}
items = SP - MARK++;
- if (sv_isobject(*MARK)) {
+ if (sv_isobject(*MARK)) { /* Calls GET magic. */
ENTER;
PUSHSTACKi(PERLSI_MAGIC);
PUSHMARK(SP);
@@ -839,10 +839,12 @@ PP(pp_tie)
/* Not clear why we don't call call_method here too.
* perhaps to get different error message ?
*/
- stash = gv_stashsv(*MARK, 0);
+ STRLEN len;
+ const char *name = SvPV_nomg_const(*MARK, len);
+ stash = gv_stashpvn(name, len, 0);
if (!stash || !(gv = gv_fetchmethod(stash, methname))) {
DIE(aTHX_ "Can't locate object method \"%s\" via package \"%"SVf"\"",
- methname, SVfARG(*MARK));
+ methname, SVfARG(SvOK(*MARK) ? *MARK : &PL_sv_no));
}
ENTER;
PUSHSTACKi(PERLSI_MAGIC);