diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2024-02-07 14:23:37 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2024-02-15 22:34:49 +0100 |
commit | ebc65409e3e96de471791e3c1662cb19c8822f31 (patch) | |
tree | 30088a88061dc992236176c659c60e6c44e86032 /src/qml/jsruntime | |
parent | 4d13ed6a598c142f9ed9928fa0bdcb395e4b94cc (diff) |
V4: Fix setting of regexp flags
We of course have to amend the previously set flags, not the origin.
This only worked sort of because most of the flags are the same in input
and output.
This causes one test in the ECMAScript suite to pass and three to fail.
Those three were passing for the wrong reason, relying on the confusion
between the unicode and sticky flags. The failures are actually due to a
defect in Yarr that will have to be addressed separately.
Fixes: QTBUG-121509
Change-Id: Id930bba49e12dede2eb699e446eb528072f092b4
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r-- | src/qml/jsruntime/qv4regexp.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4regexp.cpp b/src/qml/jsruntime/qv4regexp.cpp index 4629a409ac..9c48199157 100644 --- a/src/qml/jsruntime/qv4regexp.cpp +++ b/src/qml/jsruntime/qv4regexp.cpp @@ -17,15 +17,15 @@ static JSC::RegExpFlags jscFlags(uint flags) { JSC::RegExpFlags jscFlags = JSC::NoFlags; if (flags & CompiledData::RegExp::RegExp_Global) - jscFlags = static_cast<JSC::RegExpFlags>(flags | JSC::FlagGlobal); + jscFlags = static_cast<JSC::RegExpFlags>(jscFlags | JSC::FlagGlobal); if (flags & CompiledData::RegExp::RegExp_IgnoreCase) - jscFlags = static_cast<JSC::RegExpFlags>(flags | JSC::FlagIgnoreCase); + jscFlags = static_cast<JSC::RegExpFlags>(jscFlags | JSC::FlagIgnoreCase); if (flags & CompiledData::RegExp::RegExp_Multiline) - jscFlags = static_cast<JSC::RegExpFlags>(flags | JSC::FlagMultiline); + jscFlags = static_cast<JSC::RegExpFlags>(jscFlags | JSC::FlagMultiline); if (flags & CompiledData::RegExp::RegExp_Unicode) - jscFlags = static_cast<JSC::RegExpFlags>(flags | JSC::FlagUnicode); + jscFlags = static_cast<JSC::RegExpFlags>(jscFlags | JSC::FlagUnicode); if (flags & CompiledData::RegExp::RegExp_Sticky) - jscFlags = static_cast<JSC::RegExpFlags>(flags | JSC::FlagSticky); + jscFlags = static_cast<JSC::RegExpFlags>(jscFlags | JSC::FlagSticky); return jscFlags; } |