summaryrefslogtreecommitdiff
path: root/mro.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-09-12 21:02:55 +0000
committerNicholas Clark <nick@ccl4.org>2008-09-12 21:02:55 +0000
commited09b296cb65baf1e63050da7be88c8877c28d10 (patch)
treeaaab24f942e70a271e33edb57823d0920d589635 /mro.c
parent6e4aef591331d48363634d9ad4a01d6c6b5f5577 (diff)
downloadperl-ed09b296cb65baf1e63050da7be88c8877c28d10.tar.gz
In S_mro_get_linear_isa_dfs(), add void casts to silence two warnings
about "value computed is not used". Re-order the code to group operations on the isa hash with each other. Add a SvREADONLY_on() on the isa array if it is generated by Perl_get_isa_hash(). p4raw-id: //depot/perl@34357
Diffstat (limited to 'mro.c')
-rw-r--r--mro.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/mro.c b/mro.c
index b15ec3a69c..f2cbee3cf9 100644
--- a/mro.c
+++ b/mro.c
@@ -124,6 +124,8 @@ Perl_get_isa_hash(pTHX_ HV *const stash)
HEK_HASH(canon_name));
(void) hv_store(isa_hash, "UNIVERSAL", 9, &PL_sv_undef, 0);
+ SvREADONLY_on(isa_hash);
+
meta->isa = isa_hash;
}
}
@@ -259,24 +261,26 @@ S_mro_get_linear_isa_dfs(pTHX_ HV *stash, I32 level)
}
}
+ (void) hv_store_ent(stored, our_name, &PL_sv_undef, 0);
+ (void) hv_store(stored, "UNIVERSAL", 9, &PL_sv_undef, 0);
+
+ SvREFCNT_inc_simple_void_NN(stored);
+ SvTEMP_off(stored);
+ SvREADONLY_on(stored);
+
+ meta->isa = stored;
+
/* now that we're past the exception dangers, grab our own reference to
the AV we're about to use for the result. The reference owned by the
mortals' stack will be released soon, so everything will balance. */
SvREFCNT_inc_simple_void_NN(retval);
SvTEMP_off(retval);
- SvREFCNT_inc_simple_void_NN(stored);
- SvTEMP_off(stored);
-
- hv_store_ent(stored, our_name, &PL_sv_undef, 0);
- hv_store(stored, "UNIVERSAL", 9, &PL_sv_undef, 0);
/* we don't want anyone modifying the cache entry but us,
and we do so by replacing it completely */
SvREADONLY_on(retval);
- SvREADONLY_on(stored);
meta->mro_linear_dfs = retval;
- meta->isa = stored;
return retval;
}