]> git.vpit.fr Git - perl/modules/Variable-Magic.git/commitdiff
Make getsig() croak if the supplied wizard is incorrect
authorVincent Pit <vince@profvince.com>
Tue, 3 Mar 2009 00:47:26 +0000 (01:47 +0100)
committerVincent Pit <vince@profvince.com>
Tue, 3 Mar 2009 00:47:26 +0000 (01:47 +0100)
Magic.xs

index ab8a1c540955ab283216b263df549879b736c688..0bd0bfd2ba1d45668266d373b0d04f0c4f884abd 100644 (file)
--- a/Magic.xs
+++ b/Magic.xs
@@ -1408,10 +1408,11 @@ OUTPUT:
 
 SV *getsig(SV *wiz)
 PROTOTYPE: $
+PREINIT:
+ U16 sig;
 CODE:
- if (!SvROK(wiz))
-  croak(vmg_invalid_wiz);
- RETVAL = newSVuv(SV2MGWIZ(SvRV(wiz))->sig);
+ sig = vmg_wizard_sig(wiz);
+ RETVAL = newSVuv(sig);
 OUTPUT:
  RETVAL