summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-05-08 22:09:18 +0000
committerNicholas Clark <nick@ccl4.org>2005-05-08 22:09:18 +0000
commitce5030a2e3d52efc311b379279a2db8219fc84b1 (patch)
tree53235fae81cd214056b3d086fd220cc688dd3a57
parent03e367892efb7218f1a5ccab257a8ceaf34be0f3 (diff)
downloadperl-ce5030a2e3d52efc311b379279a2db8219fc84b1.tar.gz
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
-rw-r--r--mg.c3
-rw-r--r--perl.h4
-rw-r--r--pp.c3
-rw-r--r--pp_hot.c3
4 files changed, 5 insertions, 8 deletions
diff --git a/mg.c b/mg.c
index 8fa8ae9f48..21a3747e6c 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 a0c39f97d4..bb0081c95f 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 fa32601167..0761ff1eab 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 97d7e28868..f6caadb396 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);