diff options
author | Maciej Rzasa <maciejrzasa@gmail.com> | 2025-02-21 00:42:05 +0100 |
---|---|---|
committer | Nobuyoshi Nakada <nobu.nakada@gmail.com> | 2025-02-28 12:34:38 +0900 |
commit | a50fbc56a30a0665102781019029e9cf9ddb3576 (patch) | |
tree | 359cc4df80255f25217ae2c31850495500ff298d /regparse.c | |
parent | 025832c3859c4369ed12ace13e35523bd04116fe (diff) |
Use mbuf instead of bitset for character class for small UTF. Fixes #16145
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12787
Diffstat (limited to 'regparse.c')
-rw-r--r-- | regparse.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/regparse.c b/regparse.c index 6f1fbf8191..9c92ff8cbc 100644 --- a/regparse.c +++ b/regparse.c @@ -5669,7 +5669,7 @@ i_apply_case_fold(OnigCodePoint from, OnigCodePoint to[], if ((is_in != 0 && !IS_NCCLASS_NOT(cc)) || (is_in == 0 && IS_NCCLASS_NOT(cc))) { if (add_flag) { - if (ONIGENC_MBC_MINLEN(env->enc) > 1 || *to >= SINGLE_BYTE_SIZE) { + if (ONIGENC_MBC_MINLEN(env->enc) > 1 || *to >= 0x80) { r = add_code_range0(&(cc->mbuf), env, *to, *to, 0); if (r < 0) return r; } @@ -5681,7 +5681,7 @@ i_apply_case_fold(OnigCodePoint from, OnigCodePoint to[], #else if (is_in != 0) { if (add_flag) { - if (ONIGENC_MBC_MINLEN(env->enc) > 1 || *to >= SINGLE_BYTE_SIZE) { + if (ONIGENC_MBC_MINLEN(env->enc) > 1 || *to >= 0x80) { if (IS_NCCLASS_NOT(cc)) clear_not_flag_cclass(cc, env->enc); r = add_code_range0(&(cc->mbuf), env, *to, *to, 0); if (r < 0) return r; |