From: Jarkko Hietaniemi Date: Mon, 4 Dec 2000 16:42:17 +0000 (+0000) Subject: Retract #7977, still too volatile (the euphemism of the day X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6bfc225dd053d6d16a741d24c9f3dd2d90b0a1ae;p=p5sagit%2Fp5-mst-13.2.git Retract #7977, still too volatile (the euphemism of the day for unfinished and buggy :-) p4raw-id: //depot/perl@7978 --- diff --git a/doop.c b/doop.c index 762c679..3c34425 100644 --- a/doop.c +++ b/doop.c @@ -1177,11 +1177,8 @@ Perl_do_kv(pTHX) PUTBACK; /* hv_iternext and hv_iterval might clobber stack_sp */ while ((entry = hv_iternext(keys))) { SPAGAIN; - if (dokeys) { + if (dokeys) XPUSHs(hv_iterkeysv(entry)); /* won't clobber stack_sp */ - if (SvUTF8((SV*)keys)) - SvUTF8_on(TOPs); /* Yuck */ - } if (dovalues) { PUTBACK; tmpstr = realhv ? diff --git a/hv.c b/hv.c index 51c8d0a..8a43a19 100644 --- a/hv.c +++ b/hv.c @@ -245,9 +245,6 @@ Perl_hv_fetch_ent(pTHX_ HV *hv, SV *keysv, I32 lval, register U32 hash) if (!hv) return 0; - if (SvUTF8((SV*)hv) && !SvUTF8(keysv)) - sv_utf8_upgrade(keysv); - if (SvRMAGICAL(hv)) { if (mg_find((SV*)hv,'P')) { dTHR; @@ -466,20 +463,6 @@ Perl_hv_store_ent(pTHX_ HV *hv, SV *keysv, SV *val, register U32 hash) return 0; xhv = (XPVHV*)SvANY(hv); - - if (SvUTF8((SV*)hv) && !SvUTF8(keysv)) - sv_utf8_upgrade(keysv); - else if (SvUTF8(keysv) && !SvUTF8((SV*)hv)) { /* Upgrade hash */ - SvUTF8_on((SV*)hv); - /* XXX Need to save iterator to prevent weird things during "each" */ - (void)hv_iterinit(hv); - while (entry = hv_iternext(hv)) { - if (HeKLEN(entry) != HEf_SVKEY) /* Upgrade to SV key */ - HeSVKEY_set(entry, newSVpvn(HeKEY(entry), HeKLEN(entry))); - sv_utf8_upgrade(HeKEY_sv(entry)); - } - } - if (SvMAGICAL(hv)) { dTHR; bool needs_copy; diff --git a/pp.c b/pp.c index b3e2030..10e6c6a 100644 --- a/pp.c +++ b/pp.c @@ -2693,8 +2693,6 @@ PP(pp_each) EXTEND(SP, 2); if (entry) { PUSHs(hv_iterkeysv(entry)); /* won't clobber stack_sp */ - if (SvUTF8((SV*)hash)) - SvUTF8_on(TOPs); if (gimme == G_ARRAY) { SV *val; PUTBACK; diff --git a/sv.h b/sv.h index 42a4e39..425acc3 100644 --- a/sv.h +++ b/sv.h @@ -227,7 +227,7 @@ perform the upgrade if necessary. See C. #define SVrepl_EVAL 0x40000000 /* Replacement part of s///e */ -#define SVphv_SHAREKEYS 0x80000000 /* keys live on shared string table */ +#define SVphv_SHAREKEYS 0x20000000 /* keys live on shared string table */ #define SVphv_LAZYDEL 0x40000000 /* entry in xhv_eiter must be deleted */ #define SVprv_WEAKREF 0x80000000 /* Weak reference */