diff options
author | Karl Williamson <public@khwilliamson.com> | 2011-09-26 13:24:08 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2011-10-01 09:15:32 -0600 |
commit | a9a337f8598b831e08f2803315bce26f96d6d703 (patch) | |
tree | 1b4d353f31d5ae58dc179bd58a8ea762c6e7518c /regexec.c | |
parent | 32f89ef61d006e06f334c5a094e4ef398f4fcdbb (diff) | |
download | perl-a9a337f8598b831e08f2803315bce26f96d6d703.tar.gz |
regexec.c: Avoid hard-coded utf8 tests for EBCDIC
When a swash is loaded, generally it is checked for sanity with an
assert(). The strings used are hard-coded utf8 strings, which will be
different in EBCDIC, and hence will fail. I haven't figured out a
simple way to get compile-time utf8 vs utfebcdic strings, but we can
just skip the check in EBCDIC builds
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -122,12 +122,18 @@ #define HOP3c(pos,off,lim) ((char*)HOP3(pos,off,lim)) /* these are unrolled below in the CCC_TRY_XXX defined */ -#define LOAD_UTF8_CHARCLASS(class,str) STMT_START { \ +#ifdef EBCDIC + /* Often 'str' is a hard-coded utf8 string instead of utfebcdic. so just + * skip the check on EBCDIC platforms */ +# define LOAD_UTF8_CHARCLASS(class,str) LOAD_UTF8_CHARCLASS_NO_CHECK(class) +#else +# define LOAD_UTF8_CHARCLASS(class,str) STMT_START { \ if (!CAT2(PL_utf8_,class)) { \ bool ok; \ ENTER; save_re_context(); \ ok=CAT2(is_utf8_,class)((const U8*)str); \ assert(ok); assert(CAT2(PL_utf8_,class)); LEAVE; } } STMT_END +#endif /* Doesn't do an assert to verify that is correct */ #define LOAD_UTF8_CHARCLASS_NO_CHECK(class) STMT_START { \ |