summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embed.fnc4
-rw-r--r--proto.h4
-rw-r--r--sv.c15
3 files changed, 11 insertions, 12 deletions
diff --git a/embed.fnc b/embed.fnc
index 45f3a927dc..4b37eac6e4 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -985,8 +985,8 @@ Apa |PerlIO*|fp_dup |NULLOK PerlIO* fp|char type|NN CLONE_PARAMS* param
Apa |DIR* |dirp_dup |NULLOK DIR* dp
Apa |GP* |gp_dup |NULLOK GP* gp|NN CLONE_PARAMS* param
Apa |MAGIC* |mg_dup |NULLOK MAGIC* mg|NN CLONE_PARAMS* param
-Apa |SV* |sv_dup |NULLOK SV* sstr|NN CLONE_PARAMS* param
-Ap |void |rvpv_dup |NN SV* dstr|NN SV *sstr|NN CLONE_PARAMS* param
+Apa |SV* |sv_dup |NULLOK const SV* sstr|NN CLONE_PARAMS* param
+Ap |void |rvpv_dup |NN SV* dstr|NN const SV *sstr|NN CLONE_PARAMS* param
Apa |PTR_TBL_t*|ptr_table_new
Apa |void* |ptr_table_fetch|NN PTR_TBL_t *tbl|NN const void *sv
Ap |void |ptr_table_store|NN PTR_TBL_t *tbl|NULLOK const void *oldsv|NN void *newsv
diff --git a/proto.h b/proto.h
index 3a265d767a..4c53afb56f 100644
--- a/proto.h
+++ b/proto.h
@@ -2765,12 +2765,12 @@ PERL_CALLCONV MAGIC* Perl_mg_dup(pTHX_ MAGIC* mg, CLONE_PARAMS* param)
__attribute__warn_unused_result__
__attribute__nonnull__(pTHX_2);
-PERL_CALLCONV SV* Perl_sv_dup(pTHX_ SV* sstr, CLONE_PARAMS* param)
+PERL_CALLCONV SV* Perl_sv_dup(pTHX_ const SV* sstr, CLONE_PARAMS* param)
__attribute__malloc__
__attribute__warn_unused_result__
__attribute__nonnull__(pTHX_2);
-PERL_CALLCONV void Perl_rvpv_dup(pTHX_ SV* dstr, SV *sstr, CLONE_PARAMS* param)
+PERL_CALLCONV void Perl_rvpv_dup(pTHX_ SV* dstr, const SV *sstr, CLONE_PARAMS* param)
__attribute__nonnull__(pTHX_1)
__attribute__nonnull__(pTHX_2)
__attribute__nonnull__(pTHX_3);
diff --git a/sv.c b/sv.c
index 781222ea1e..8f3e9cd220 100644
--- a/sv.c
+++ b/sv.c
@@ -9179,7 +9179,7 @@ Perl_ptr_table_free(pTHX_ PTR_TBL_t *tbl)
void
-Perl_rvpv_dup(pTHX_ SV *dstr, SV *sstr, CLONE_PARAMS* param)
+Perl_rvpv_dup(pTHX_ SV *dstr, const SV *sstr, CLONE_PARAMS* param)
{
if (SvROK(sstr)) {
SvRV_set(dstr, SvWEAKREF(sstr)
@@ -9225,7 +9225,7 @@ Perl_rvpv_dup(pTHX_ SV *dstr, SV *sstr, CLONE_PARAMS* param)
/* duplicate an SV of any type (including AV, HV etc) */
SV *
-Perl_sv_dup(pTHX_ SV *sstr, CLONE_PARAMS* param)
+Perl_sv_dup(pTHX_ const SV *sstr, CLONE_PARAMS* param)
{
dVAR;
SV *dstr;
@@ -9240,12 +9240,11 @@ Perl_sv_dup(pTHX_ SV *sstr, CLONE_PARAMS* param)
if(param->flags & CLONEf_JOIN_IN) {
/** We are joining here so we don't want do clone
something that is bad **/
- const char *hvname;
-
- if(SvTYPE(sstr) == SVt_PVHV &&
- (hvname = HvNAME_get(sstr))) {
- /** don't clone stashes if they already exist **/
- return (SV*)gv_stashpv(hvname,0);
+ if (SvTYPE(sstr) == SVt_PVHV) {
+ const char * const hvname = HvNAME_get(sstr);
+ if (hvname)
+ /** don't clone stashes if they already exist **/
+ return (SV*)gv_stashpv(hvname,0);
}
}