regexec.c: Add some checks
authorKarl Williamson <public@khwilliamson.com>
Mon, 17 Feb 2014 23:04:06 +0000 (16:04 -0700)
committerKarl Williamson <public@khwilliamson.com>
Wed, 19 Feb 2014 15:32:59 +0000 (08:32 -0700)
These aren't currently needed, but a future commit will change so things
need to be more general

regexec.c

index 28b0bb9..c93171d 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -7563,7 +7563,8 @@ S_core_regclass_swash(pTHX_ const regexp *prog, const regnode* node, bool doinit
            if (ary[1] && SvROK(ary[1])) {
                sw = ary[1];
            }
-           else if (si && doinit) {
+           else if (doinit && ((si && si != &PL_sv_undef)
+                                 || (invlist && invlist != &PL_sv_undef))) {
 
                sw = _core_swash_init("utf8", /* the utf8 package */
                                      "", /* nameless */