X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pp_sys.c;h=833e5656aff6a5b2b99196681ecfa7f33c0ded08;hb=bc3f1c14f93bf857a045b618293617218d759095;hp=59439e9f1703393482eb42064c6366a49d37e22d;hpb=eff494dd14cc5afe1a584bb7e0000a62b81acc19;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pp_sys.c b/pp_sys.c index 59439e9..833e565 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -762,8 +762,12 @@ PP(pp_binmode) PUTBACK; { - const int mode = mode_from_discipline(discp); - const char *const d = (discp ? SvPV_nolen_const(discp) : NULL); + STRLEN len = 0; + const char *d = NULL; + int mode; + if (discp) + d = SvPV_const(discp, len); + mode = mode_from_discipline(d, len); if (PerlIO_binmode(aTHX_ fp, IoTYPE(io), mode, d)) { if (IoOFP(io) && IoOFP(io) != IoIFP(io)) { if (!PerlIO_binmode(aTHX_ IoOFP(io), IoTYPE(io), mode, d)) { @@ -821,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); @@ -835,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);