-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[regex] fix uncaught exception when string is like "\\_" #129348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-libcxx Author: Austin (Zhenhang1213) Changesfixes #129062 Full diff: https://github.com/llvm/llvm-project/pull/129348.diff 1 Files Affected:
diff --git a/libcxx/include/regex b/libcxx/include/regex
index 36ea55ce30921..6916f91628821 100644
--- a/libcxx/include/regex
+++ b/libcxx/include/regex
@@ -3954,7 +3954,7 @@ _ForwardIterator basic_regex<_CharT, _Traits>::__parse_character_escape(
++__first;
break;
default:
- if (*__first != '_' && !__traits_.isctype(*__first, ctype_base::alnum)) {
+ if (!__traits_.isctype(*__first, ctype_base::alnum)) {
if (__str)
*__str = *__first;
else
|
@frederick-vs-ja where could I find those tests? |
I think we can add a new case to |
✅ With the latest revision this PR passed the C/C++ code formatter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this. I've some comments.
d7c42f1
to
dfd5830
Compare
5fe7f21
to
3c29eb9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question: why didn't you rebase the branch onto the head of llvm:main while rebasing many times?
Right, I update it |
7735c38
to
13cff4e
Compare
e3dceed
to
0f24183
Compare
0f24183
to
2f84921
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM!
Do you need somebody to land this patch for you?
\_
is a valid identity escape in regular expressions, but previously libc++ incorrectly treated it as invalid. So I deleted this judgmentfixes #129062