diff options
author | Karl Williamson <public@khwilliamson.com> | 2012-08-24 14:38:02 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-08-25 23:21:29 -0600 |
commit | 872dd7e02968b0b8c2eb1b53c82bd05cff5080c9 (patch) | |
tree | 64a3e42904361fd9941d9bd55f82ab21caa334c6 /utf8.c | |
parent | 6dd9dce957a17e45449a2fa4e684b1b241302529 (diff) | |
download | perl-872dd7e02968b0b8c2eb1b53c82bd05cff5080c9.tar.gz |
regexec.c: Use get method instead of internals
A new get method has been written to access the internals of a swash
it's best to use it.
This also moves the error checking to the method
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -4142,10 +4142,16 @@ Perl__swash_to_invlist(pTHX_ SV* const swash) SV* Perl__get_swash_invlist(pTHX_ SV* const swash) { - SV** ptr = hv_fetchs(MUTABLE_HV(SvRV(swash)), "INVLIST", FALSE); + SV** ptr; PERL_ARGS_ASSERT__GET_SWASH_INVLIST; + if (! SvROK(swash) || SvTYPE(SvRV(swash)) != SVt_PVHV) { + return NULL; + } + + ptr = hv_fetchs(MUTABLE_HV(SvRV(swash)), "INVLIST", FALSE); + if (! ptr) { return NULL; } |