From ed09b296cb65baf1e63050da7be88c8877c28d10 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Fri, 12 Sep 2008 21:02:55 +0000 Subject: [PATCH] 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 --- mro.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/mro.c b/mro.c index b15ec3a..f2cbee3 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; } -- 2.7.4