summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--regexec.c4
-rw-r--r--t/re/script_run.t1
2 files changed, 5 insertions, 0 deletions
diff --git a/regexec.c b/regexec.c
index 1cd61de812..b41f680258 100644
--- a/regexec.c
+++ b/regexec.c
@@ -10394,6 +10394,10 @@ Perl_isSCRIPT_RUN(pTHX_ const U8 * s, const U8 * send, const bool utf8_target, S
* another set has already been encountered. (The other digit ranges
* in Common are not similarly blessed) */
if (UNLIKELY(isDIGIT(*s))) {
+ if (UNLIKELY(script_of_run == SCX_Unknown)) {
+ retval = FALSE;
+ break;
+ }
if (zero_of_run > 0) {
if (zero_of_run != '0') {
retval = FALSE;
diff --git a/t/re/script_run.t b/t/re/script_run.t
index b892d757a7..a1b877efa1 100644
--- a/t/re/script_run.t
+++ b/t/re/script_run.t
@@ -62,6 +62,7 @@ like("\N{U+03A2}", $script_run, "A single unassigned code point is a script run"
unlike("\N{U+03A2}\N{U+03A2}", $script_run, "But not more than one");
unlike("A\N{U+03A2}", $script_run, "... and not in combination with an assigned one");
unlike("\N{U+03A2}A", $script_run, "... in either order");
+unlike("\N{U+03A2}0", $script_run, "... nor with a digit following");
like("A\N{COMBINING GRAVE ACCENT}", $script_run, "An inherited script matches others");
like("\N{COMBINING GRAVE ACCENT}A", $script_run, "... even if first in the sequence");