Skip to content

Commit

Permalink
regcomp.c: Handle /ss\xdf/iaa properly
Browse files Browse the repository at this point in the history
Having both ss and \xdf in a string caused the node type to be changed
back to a wrong one.

This fixes #17486
  • Loading branch information
khwilliamson committed Apr 2, 2020
1 parent 5de22a4 commit c6d745d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion regcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -4440,7 +4440,7 @@ S_join_exact(pTHX_ RExC_state_t *pRExC_state, regnode *scan,
s++;
}
}
else {
else if (OP(scan) != EXACTFAA_NO_TRIE) {

/* Non-UTF-8 pattern, not EXACTFAA node. Look for the multi-char
* folds that are all Latin1. As explained in the comments
Expand Down
6 changes: 6 additions & 0 deletions t/re/pat_advanced.t
Original file line number Diff line number Diff line change
Expand Up @@ -2527,6 +2527,11 @@ EOF
"", {}, "*COMMIT caused positioning beyond EOS");
}

{ # [GH #17486] Previously assertion failure
fresh_perl_is('0=~/(?iaa)ss\337(?0)|/',
"", {}, "EXACTFUP node isn't changed into something else");
}


# !!! NOTE that tests that aren't at all likely to crash perl should go
# a ways above, above these last ones. There's a comment there that, like
Expand All @@ -2536,3 +2541,4 @@ EOF
} # End of sub run_tests

1;
0=~/(?iaa)ss\337(?0)|/

0 comments on commit c6d745d

Please sign in to comment.