From: Nicholas Clark Date: Sun, 8 May 2005 22:09:18 +0000 (+0000) Subject: Perl_croak uses perl's printf, so can pass in SVs direct - no need for X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ce5030a2e3d52efc311b379279a2db8219fc84b1;p=p5sagit%2Fp5-mst-13.2.git Perl_croak uses perl's printf, so can pass in SVs direct - no need for SvPV and a %s format. p4raw-id: //depot/perl@24420 --- diff --git a/mg.c b/mg.c index 8fa8ae9..21a3747 100644 --- a/mg.c +++ b/mg.c @@ -1927,12 +1927,11 @@ Perl_vivify_defelem(pTHX_ SV *sv) return; if (mg->mg_obj) { SV *ahv = LvTARG(sv); - STRLEN n_a; HE *he = hv_fetch_ent((HV*)ahv, mg->mg_obj, TRUE, 0); if (he) value = HeVAL(he); if (!value || value == &PL_sv_undef) - Perl_croak(aTHX_ PL_no_helem, SvPV(mg->mg_obj, n_a)); + Perl_croak(aTHX_ PL_no_helem_sv, mg->mg_obj); } else { AV* av = (AV*)LvTARG(sv); diff --git a/perl.h b/perl.h index a0c39f9..bb0081c 100644 --- a/perl.h +++ b/perl.h @@ -3358,8 +3358,8 @@ EXTCONST char PL_no_usym[] INIT("Can't use an undefined value as %s reference"); EXTCONST char PL_no_aelem[] INIT("Modification of non-creatable array value attempted, subscript %d"); -EXTCONST char PL_no_helem[] - INIT("Modification of non-creatable hash value attempted, subscript \"%s\""); +EXTCONST char PL_no_helem_sv[] + INIT("Modification of non-creatable hash value attempted, subscript \""SVf"\""); EXTCONST char PL_no_modify[] INIT("Modification of a read-only value attempted"); EXTCONST char PL_no_mem[] diff --git a/pp.c b/pp.c index fa32601..0761ff1 100644 --- a/pp.c +++ b/pp.c @@ -4025,8 +4025,7 @@ PP(pp_hslice) if (lval) { if (!svp || *svp == &PL_sv_undef) { - STRLEN n_a; - DIE(aTHX_ PL_no_helem, SvPV(keysv, n_a)); + DIE(aTHX_ PL_no_helem_sv, keysv); } if (localizing) { if (preeminent) diff --git a/pp_hot.c b/pp_hot.c index 97d7e28..f6caadb 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -1709,8 +1709,7 @@ PP(pp_helem) SV* lv; SV* key2; if (!defer) { - STRLEN n_a; - DIE(aTHX_ PL_no_helem, SvPV(keysv, n_a)); + DIE(aTHX_ PL_no_helem_sv, keysv); } lv = sv_newmortal(); sv_upgrade(lv, SVt_PVLV);