summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-09-26 13:24:08 -0600
committerKarl Williamson <public@khwilliamson.com>2011-10-01 09:15:32 -0600
commita9a337f8598b831e08f2803315bce26f96d6d703 (patch)
tree1b4d353f31d5ae58dc179bd58a8ea762c6e7518c /regexec.c
parent32f89ef61d006e06f334c5a094e4ef398f4fcdbb (diff)
downloadperl-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.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/regexec.c b/regexec.c
index e6d3fa41df..1aa6129423 100644
--- a/regexec.c
+++ b/regexec.c
@@ -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 { \