develooper Front page | perl.perl5.porters | Postings from May 2019

[perl #134140] Prevent use of characters above \xFF in bitwisestring ops

Thread Next
From:
James E Keenan via RT
Date:
May 28, 2019 02:02
Subject:
[perl #134140] Prevent use of characters above \xFF in bitwisestring ops
Message ID:
rt-4.0.24-1195-1559008939-248.134140-15-0@perl.org
On Sat, 25 May 2019 02:13:08 GMT, jkeenan@pobox.com wrote:
> pod/perldeprecation.pod contains this entry for perl-5.32:
> 
> #####
> Use of code points over 0xFF in string bitwise operators
> 
> The string bitwise operators, "&", "|", "^", and "~", treat
> their operands as strings of bytes. As such, values above
> 0xFF are nonsensical. Some instances of these have been
> deprecated since Perl 5.24, and were made fatal in 5.28,
> but it turns out that in cases where the wide characters
> did not affect the end result, no deprecation notice was
> raised, and so remain legal. Now, all occurrences either
> are fatal or raise a deprecation warning, so that the
> remaining legal occurrences will be fatal in 5.32.
> 
> An example of this is
> 
> "" & "\x{100}"
> 
> The wide character is not used in the "&" operation because
> the left operand is shorter. This now warns anyway.
> #####
> 
> This entry was made in the following commit:
> 
> #####
> commit ba52ce15fe5ca68de1be69e394f41ccb48a731cc Author:
> Karl Williamson <khw@cpan.org> Date: Tue Dec 19 16:03:39
> 2017 -0700
> 
> Deprecate above \xFF in bitwise string ops
> 
> This is already a fatal error for operations whose outcome
> depends on them, but in things like
> 
> "abc" & "def\x{100}"
> 
> the wide character doesn't actually need to participate in
> the AND, and so perl doesn't. As a result of the discussion
> in the thread beginning with
> http://nntp.perl.org/group/perl.perl5.porters/244884, it
> was decided to deprecate these ones too.
> #####
> 
> Make it so.

Please review patch attached.  Available for smoking in this branch:

smoke-me/jkeenan/rt-134140-bitwise

Thank you very much.

-- 
James E Keenan (jkeenan@cpan.org)

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=134140

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About