From: Anno Siegel Date: Fri, 14 Jul 2006 16:33:01 +0000 (+0200) Subject: Silence a compiler warning on Win32/VC++ X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=45552c86ce82387c803bebecc310f9b2e717f52c;p=p5sagit%2Fp5-mst-13.2.git Silence a compiler warning on Win32/VC++ Subject: Re: Smoke [5.9.4] 28569 FAIL(F) MSWin32 WinXP/.Net SP2 (x86/2 cpu) Message-Id: <8CC2FF7E-42EE-4B28-A9D2-4FCD8C745004@mailbox.tu-berlin.de> p4raw-id: //depot/perl@28573 --- diff --git a/ext/Hash/Util/FieldHash/FieldHash.xs b/ext/Hash/Util/FieldHash/FieldHash.xs index 44ff3ce..8aa8c9c 100644 --- a/ext/Hash/Util/FieldHash/FieldHash.xs +++ b/ext/Hash/Util/FieldHash/FieldHash.xs @@ -29,16 +29,15 @@ HV* HUF_get_ob_reg(void) { items = call_pv(HUF_OB_REG, G_SCALAR|G_NOARGS); SPAGAIN; - if (items == 1 && TOPs && SvROK(TOPs) && SvTYPE(SvRV(TOPs)) == SVt_PVHV) { + if (items == 1 && TOPs && SvROK(TOPs) && SvTYPE(SvRV(TOPs)) == SVt_PVHV) ob_reg = (HV*)SvRV(POPs); - } PUTBACK; FREETMPS; LEAVE; - if (ob_reg) - return ob_reg; - Perl_die(aTHX_ "Can't get object registry hash"); + if (!ob_reg) + Perl_die(aTHX_ "Can't get object registry hash"); + return ob_reg; } /* Deal with global context */ @@ -192,16 +191,18 @@ void HUF_mark_field(SV* trigger, SV* field) { I32 HUF_watch_key(pTHX_ IV action, SV* field) { MAGIC* mg = mg_find(field, PERL_MAGIC_uvar); SV* keysv; - if (!mg) - Perl_die(aTHX_ "Rogue call of 'HUF_watch_key'"); - keysv = mg->mg_obj; - if (keysv && SvROK(keysv)) { - SV* ob_id = HUF_obj_id(keysv); - mg->mg_obj = ob_id; /* key replacement */ - if (HUF_WOULD_CREATE_KEY(action)) { - SV* trigger = HUF_get_trigger(keysv, ob_id); - HUF_mark_field(trigger, field); + if (mg) { + keysv = mg->mg_obj; + if (keysv && SvROK(keysv)) { + SV* ob_id = HUF_obj_id(keysv); + mg->mg_obj = ob_id; /* key replacement */ + if (HUF_WOULD_CREATE_KEY(action)) { + SV* trigger = HUF_get_trigger(keysv, ob_id); + HUF_mark_field(trigger, field); + } } + } else { + Perl_die(aTHX_ "Rogue call of 'HUF_watch_key'"); } return 0; }