diff --git a/re2/parse.cc b/re2/parse.cc index 545b965e..0a767896 100644 --- a/re2/parse.cc +++ b/re2/parse.cc @@ -1787,7 +1787,7 @@ ParseStatus ParseUnicodeGroup(absl::string_view* s, absl::string_view name; // Han or L s->remove_prefix(2); // '\\', 'p' - if (!StringViewToRune(&c, s, status)) + if (StringViewToRune(&c, s, status) < 0) return kParseError; if (c != '{') { // Name is the bit of string we just skipped over for c. diff --git a/re2/testing/parse_test.cc b/re2/testing/parse_test.cc index 53ef24ec..639de681 100644 --- a/re2/testing/parse_test.cc +++ b/re2/testing/parse_test.cc @@ -583,4 +583,19 @@ TEST(LookAround, ErrorArgs) { EXPECT_EQ(status.error_arg(), "(?