diff options
author | Karl Williamson <khw@cpan.org> | 2019-12-26 16:00:50 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2019-12-29 22:44:40 -0700 |
commit | a68ea46312935021280f02a7264d25531882473a (patch) | |
tree | f4257d0d3ee99148fbcf2616d7f1ea1dd8764668 /doop.c | |
parent | 76485ef6ccc5bc9f6683f395feb40e6f32a6ebd8 (diff) | |
download | perl-a68ea46312935021280f02a7264d25531882473a.tar.gz |
PATCH: GH #17391 tr/// regression
This was the result of my not thinking through how things should work.
I added tests for the incorrect behavior. This commit modifies them, so
that there is no need for the test in the ticket.
Diffstat (limited to 'doop.c')
-rw-r--r-- | doop.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -210,13 +210,14 @@ S_do_trans_complex(pTHX_ SV * const sv, const OPtrans_map * const tbl) } } else { - if (this_map == (short) TR_UNMAPPED) + if (this_map == (short) TR_UNMAPPED) { *d++ = *s; + previous_map = (short) TR_OOB; + } else { assert(this_map == (short) TR_DELETE); matches++; } - previous_map = (short) TR_OOB; } s++; @@ -288,6 +289,7 @@ S_do_trans_complex(pTHX_ SV * const sv, const OPtrans_map * const tbl) else if (sch == (short) TR_UNMAPPED) { Move(s, d, len, U8); d += len; + pch = TR_OOB; } else if (sch == (short) TR_DELETE) matches++; @@ -298,7 +300,6 @@ S_do_trans_complex(pTHX_ SV * const sv, const OPtrans_map * const tbl) } s += len; - pch = TR_OOB; } if (grows) { @@ -522,7 +523,6 @@ S_do_trans_invmap(pTHX_ SV * const sv, AV * const invmap) if (to == (UV) TR_SPECIAL_HANDLING) { if (delete_unfound) { - previous_map = to; s += s_len; continue; } |