Skip to content

Accept \p{nv=-0} #19577

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

Merged
merged 1 commit into from
Apr 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions regcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -24679,6 +24679,15 @@ S_parse_uniprop_string(pTHX_
break;
}
}

/* Turn nv=-0 into nv=0. These should be equivalent, but vary by
* underling libc implementation. */
if ( i == name_len - 1
&& name[name_len-1] == '0'
&& lookup_name[j-1] == '-')
{
j--;
}
}
}
else { /* No '=' */
Expand Down
5 changes: 0 additions & 5 deletions t/lib/croak/regcomp
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,3 @@ qr/(?<=(?<!x)x)\K/;
qr/(?<!(?<!x)x)\K/;
EXPECT
OPTIONS nonfatal
########
# NAME numeric parsing buffer overflow in numeric.c
0=~/\p{nV:-0}/
EXPECT
Can't find Unicode property definition "nV:-0" in regex; marked by <-- HERE in m/\p{nV:-0} <-- HERE / at - line 1.
3 changes: 3 additions & 0 deletions t/re/re_tests
Original file line number Diff line number Diff line change
Expand Up @@ -2107,6 +2107,9 @@ AB\s+\x{100} AB \x{100}X y - -
/a?(*ACCEPT)b/ a y >$&< >a< - # Test minlen for ACCEPT
/a?(*ACCEPT)b/ b y >$&< >< - # Test minlen for ACCEPT
/ (A (*ACCEPT) | BC){2} D{0,4}/x A y $1 A - # ACCEPT optimizer check

\p{nv=-0} \x{660} y $& \x{660}

# Keep these lines at the end of the file
# pat string y/n/etc expr expected-expr skip-reason comment
# vim: softtabstop=0 noexpandtab