Files
UnrealEngineUWP/Engine/Source/Runtime/Core/Public/Internationalization
Jamie Dale d8a68022f2 Cleaned-up potential unsafe use of FRegexPattern
FRegexPattern could be implicitly constructed from an FString, which made it easy to accidentally pass an FString as the first argument to the FRegexMatcher constructor, and get a matcher which outlived the pattern it was using.

This changes the FRegexPattern constructor to be explicit (as you should choose to make a pattern, since it's not cheap), and also has FRegexMatcher keep a copy of the pattern it was constructed with, to ensure that the matcher can't outlive its pattern.

FRegexMatcher has also been made non-copyable, as it contains state that shouldn't be accidentally shared. FRegexPattern is now both movable and copyable, as internally it references an immutable instance so can be safely shared.

#rb Patrick.Laflamme
#preflight 606cc0dd2be7080001dc6f75

[CL 15936453 by Jamie Dale in ue5-main branch]
2021-04-06 18:58:13 -04:00
..