summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-06-16 15:09:00 +0000
committerNicholas Clark <nick@ccl4.org>2005-06-16 15:09:00 +0000
commit3a242bf865f141cec0182498303b227285835533 (patch)
tree57cd7a28a83ebf02f06cd0f6f2066ed5b59cfebb /util.c
parentad73156c09397f3cfc63484d3edc50554da0fe15 (diff)
downloadperl-3a242bf865f141cec0182498303b227285835533.tar.gz
I'm not convinced that manually creating HVs via sv_upgrade is a great
idea, but as we are, turning on shared keys makes sense. p4raw-id: //depot/perl@24874
Diffstat (limited to 'util.c')
-rw-r--r--util.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/util.c b/util.c
index 67d27d7381..004d49391b 100644
--- a/util.c
+++ b/util.c
@@ -3832,6 +3832,9 @@ Perl_scan_version(pTHX_ const char *s, SV *rv, bool qv)
AV *av = newAV();
SV* hv = newSVrv(rv, "version"); /* create an SV and upgrade the RV */
(void)sv_upgrade(hv, SVt_PVHV); /* needs to be an HV type */
+#ifndef NODEFAULT_SHAREKEYS
+ HvSHAREKEYS_on(hv); /* key-sharing on by default */
+#endif
if (*s == 'v') {
s++; /* get past 'v' */
@@ -3988,6 +3991,9 @@ Perl_new_version(pTHX_ SV *ver)
/* This will get reblessed later if a derived class*/
SV* hv = newSVrv(rv, "version");
(void)sv_upgrade(hv, SVt_PVHV); /* needs to be an HV type */
+#ifndef NODEFAULT_SHAREKEYS
+ HvSHAREKEYS_on(hv); /* key-sharing on by default */
+#endif
if ( SvROK(ver) )
ver = SvRV(ver);