Craig A. Berry [Tue, 11 Mar 2003 21:29:31 +0000 (15:29 -0600)]
From: "Craig A. Berry" <craigberry@mac.com>
Message-ID: <
3E6EA99B.9060902@mac.com>
Patch by Scott Lepage (scott.lepage@hp.com)
p4raw-id: //depot/perl@18962
if (!hv)
return Nullsv;
if (klen < 0) {
- klen = -klen;
- is_utf8 = TRUE;
+ klen = -klen;
+ is_utf8 = TRUE;
}
if (SvRMAGICAL(hv)) {
bool needs_copy;
if (needs_copy && (svp = hv_fetch(hv, key, klen, TRUE))) {
sv = *svp;
- mg_clear(sv);
+ if (SvMAGICAL(sv)) {
+ mg_clear(sv);
+ }
if (!needs_store) {
if (mg_find(sv, PERL_MAGIC_tiedelem)) {
/* No longer an element */
if (needs_copy && (entry = hv_fetch_ent(hv, keysv, TRUE, hash))) {
sv = HeVAL(entry);
- mg_clear(sv);
+ if (SvMAGICAL(sv)) {
+ mg_clear(sv);
+ }
if (!needs_store) {
if (mg_find(sv, PERL_MAGIC_tiedelem)) {
/* No longer an element */