diff options
author | Vincent Pit <perl@profvince.com> | 2008-04-30 15:14:00 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2008-04-30 11:51:12 +0000 |
commit | a91d1d4276ac73a4692bb4f0f5725c1b2817cfa8 (patch) | |
tree | f4fb6f4f23f63d003f9624a6b00dc8fa0b25192b /pp_sys.c | |
parent | 4dafff080a0de2a23b8e599ab8105c372ed372f8 (diff) | |
download | perl-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.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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); |