[llvm] [objcopy] Return an error in case of an invalid regex (PR #74319)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 7 00:18:31 PST 2023
================
@@ -39,16 +39,15 @@ NameOrPattern::create(StringRef Pattern, MatchStyle MS,
IsPositiveMatch);
}
case MatchStyle::Regex: {
- SmallVector<char, 32> Data;
- auto AnchoredPattern =
- ("^" + Pattern.ltrim('^').rtrim('$') + "$").toStringRef(Data);
- auto RegEx = std::make_shared<Regex>(AnchoredPattern);
+ auto RegEx = Regex(Pattern);
----------------
jh7370 wrote:
```suggestion
Regex RegEx(Pattern);
```
https://github.com/llvm/llvm-project/pull/74319
More information about the llvm-commits
mailing list