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

[perl #134044] Current perl undefined C behaviors

From:
Karl Williamson via RT
Date:
May 25, 2019 14:00
Subject:
[perl #134044] Current perl undefined C behaviors
Message ID:
rt-4.0.24-330-1558792834-144.134044-15-0@perl.org
These were applied as
commit 814735a391b874af8f00eaf89469e5ec7f38cd4a
 Author: Karl Williamson <khw@cpan.org>
 Date:   Fri May 3 13:57:47 2019 -0600
 
     Remove undefined behavior from IV shifting
     
     It is undefined behavior to shift a negative integer to the left.  This
     commit avoids that by treating the value as unsigned, then casting back
     to integer for return.

commit 3a019afd6f6291c3249c254b5c01e244e4ec83ab
 Author: Karl Williamson <khw@cpan.org>
 Date:   Sun Apr 28 17:42:44 2019 -0600
 
     Create fcn for lossless conversion of NV to IV
     
     Essentially the same code was being used in three places, and had
     undefined C behavior for some inputs.
     
     This consolidates the code into one inline function, and rewrites it to
     avoid undefined behavior.
-- 
Karl Williamson

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



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