mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 14:40:18 +00:00
LibRegex: Compare code units (not code points) in non-Unicode char range
This commit is contained in:
parent
e749be2295
commit
2dfcc4c307
Notes:
github-actions[bot]
2025-07-21 21:45:44 +00:00
Author: https://github.com/trflynn89
Commit: 2dfcc4c307
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5550
Reviewed-by: https://github.com/alimpfard ✅
10 changed files with 1045 additions and 1034 deletions
|
@ -531,7 +531,7 @@ ALWAYS_INLINE ExecutionResult OpCode_Compare::execute(MatchInput const& input, M
|
|||
return ExecutionResult::Failed_ExecuteLowPrioForks;
|
||||
|
||||
auto character_class = (CharClass)m_bytecode->at(offset++);
|
||||
auto ch = input.view[state.string_position_in_code_units];
|
||||
auto ch = input.view.code_unit_at(state.string_position_in_code_units);
|
||||
|
||||
compare_character_class(input, state, character_class, ch, current_inversion_state(), inverse_matched);
|
||||
break;
|
||||
|
@ -548,8 +548,8 @@ ALWAYS_INLINE ExecutionResult OpCode_Compare::execute(MatchInput const& input, M
|
|||
offset += count_insensitive;
|
||||
|
||||
bool const insensitive = input.regex_options & AllFlags::Insensitive;
|
||||
auto ch = input.view.code_unit_at(state.string_position_in_code_units);
|
||||
|
||||
auto ch = input.view[state.string_position_in_code_units];
|
||||
if (insensitive)
|
||||
ch = to_ascii_lowercase(ch);
|
||||
|
||||
|
@ -578,7 +578,7 @@ ALWAYS_INLINE ExecutionResult OpCode_Compare::execute(MatchInput const& input, M
|
|||
|
||||
auto from = value.from;
|
||||
auto to = value.to;
|
||||
auto ch = input.view[state.string_position_in_code_units];
|
||||
auto ch = input.view.code_unit_at(state.string_position_in_code_units);
|
||||
|
||||
compare_character_range(input, state, from, to, ch, current_inversion_state(), inverse_matched);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue