summaryrefslogtreecommitdiff
path: root/doop.c
diff options
context:
space:
mode:
authorJames E Keenan <jkeenan@cpan.org>2019-05-27 13:18:10 -0400
committerKarl Williamson <khw@cpan.org>2019-05-31 15:55:49 -0600
commitc8b94fe0369af7071d2cfe1221aeb0b9f6c4d284 (patch)
tree096aba503fc6810118090b08f4f4c7a175cf55c6 /doop.c
parent3a24361c312f212fa5f30c608e0c1891c8cb3ba8 (diff)
downloadperl-c8b94fe0369af7071d2cfe1221aeb0b9f6c4d284.tar.gz
Use of code points over 0xFF in string bitwise operators
Implement complete fatalization. Some instances of these were fatalized in 5.28. However, in cases where the wide characters did not affect the end result, no deprecation notice was raised. So they remained legal, though deprecated. Now, all occurrences are fatal (as of 5.32). Modify source code in doop.c. Adapt test file. Update perldiag and perldeprecation. For: RT 134140 (Commiter changed a verb to past tense in the pod)
Diffstat (limited to 'doop.c')
-rw-r--r--doop.c27
1 files changed, 4 insertions, 23 deletions
diff --git a/doop.c b/doop.c
index 8b341713a5..00edfcc2e7 100644
--- a/doop.c
+++ b/doop.c
@@ -1084,30 +1084,11 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right)
* on zeros without having to do it. In the case of '&', the result is
* zero, and the dangling portion is simply discarded. For '|' and '^', the
* result is the same as the other operand, so the dangling part is just
- * appended to the final result, unchanged. We currently accept above-FF
- * code points in the dangling portion, as that's how it has long worked,
- * and code depends on it staying that way. But it is now fatal for
- * above-FF to appear in the portion that does get operated on. Hence, any
- * above-FF must come only in the longer operand, and only in its dangling
- * portion. That means that at least one of the operands has to be
- * entirely non-UTF-8, and the length of that operand has to be before the
- * first above-FF in the other */
+ * appended to the final result, unchanged. As of perl-5.32, we no longer
+ * accept above-FF code points in the dangling portion.
+ */
if (left_utf8 || right_utf8) {
- if (left_utf8) {
- if (right_utf8 || rightlen > leftlen) {
- Perl_croak(aTHX_ FATAL_ABOVE_FF_MSG, PL_op_desc[optype]);
- }
- len = rightlen;
- }
- else if (right_utf8) {
- if (leftlen > rightlen) {
- Perl_croak(aTHX_ FATAL_ABOVE_FF_MSG, PL_op_desc[optype]);
- }
- len = leftlen;
- }
-
- Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),
- DEPRECATED_ABOVE_FF_MSG, PL_op_desc[optype]);
+ Perl_croak(aTHX_ FATAL_ABOVE_FF_MSG, PL_op_desc[optype]);
}
else { /* Neither is UTF-8 */
len = MIN(leftlen, rightlen);