diff options
author | David Mitchell <davem@iabyn.com> | 2016-11-10 20:44:16 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2016-11-12 16:15:09 +0000 |
commit | 9a70c74b0f460b0c96e443ecdfcb551157e02b51 (patch) | |
tree | b7f59e9bc08d86ebb042c3980b31991777380d4e /pp_hot.c | |
parent | 4c57ced57467061af9e672665cba30edd3391432 (diff) | |
download | perl-9a70c74b0f460b0c96e443ecdfcb551157e02b51.tar.gz |
remove DOES's usage of SvSCREAM
Currently the SvSCREAM flag is set on a temporary SV whose string value
is "isa", but where for the purposes of printing
Can't call method "XXX"
its name is treated as "DOES" rather than "isa".
Instead, set the temp SV's PVX buffer to point to a special static
string (PL_isa_DOES) whose value is "isa", but the where the error
reporting code can compare the address with PL_isa_DOES and if so, print
"DOES" instead.
This is to reduce the number of odd special cases for the SvSCREAM flag.
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -4365,6 +4365,8 @@ Perl_vivify_ref(pTHX_ SV *sv, U32 to_what) return sv; } +extern char PL_isa_DOES[]; + PERL_STATIC_INLINE HV * S_opmethod_stash(pTHX_ SV* meth) { @@ -4443,7 +4445,7 @@ S_opmethod_stash(pTHX_ SV* meth) && SvOBJECT(ob)))) { Perl_croak(aTHX_ "Can't call method \"%"SVf"\" on unblessed reference", - SVfARG((SvSCREAM(meth) && strEQ(SvPV_nolen_const(meth),"isa")) + SVfARG((SvPVX(meth) == PL_isa_DOES) ? newSVpvs_flags("DOES", SVs_TEMP) : meth)); } |