summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorVincent Pit <perl@profvince.com>2008-04-30 15:14:00 +0200
committerNicholas Clark <nick@ccl4.org>2008-05-20 12:15:13 +0000
commitfdae8a0c90de26ea7a7af37223b75994c8f1b5a0 (patch)
tree8880cb1321e0598ec883ac57f68bc1373d0600ea /pp_sys.c
parentbf6dc2ec89c2cd20fa4d51eb5a7e6f315f803af5 (diff)
downloadperl-fdae8a0c90de26ea7a7af37223b75994c8f1b5a0.tar.gz
Integrate:
[ 33770] Subject: [PATCH] Double magic/warnings with tie $x, $m From: "Vincent Pit" <perl@profvince.com> Date: Wed, 30 Apr 2008 13:14:00 +0200 (CEST) Message-ID: <62186.92.128.43.82.1209554040.squirrel@92.128.43.82> [ 33831] Subject: Re: [PATCH] Double magic with chop From: "Vincent Pit" <perl@profvince.com> Date: Thu, 15 May 2008 15:31:19 +0200 (CEST) Message-ID: <32964.147.210.17.175.1210858279.squirrel@147.210.17.175> p4raw-link: @33831 on //depot/perl: 1e968d83d8ff249abd1f06a7f900eea6b8c3fc51 p4raw-link: @33770 on //depot/perl: a91d1d4276ac73a4692bb4f0f5725c1b2817cfa8 p4raw-id: //depot/maint-5.10/perl@33880 p4raw-integrated: from //depot/perl@33879 'copy in' t/op/gmagic.t (@10223..) 'merge in' doop.c (@33457..) pp_sys.c t/lib/warnings/9uninit (@33766..)
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 da07e46e1f..c47986d8af 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -821,7 +821,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);
@@ -835,10 +835,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);