develooper Front page | perl.perl5.porters | Postings from October 2018

Re: [perl #133558] perl 5.26: use lib pragma issue in IBM AIX

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
October 17, 2018 14:25
Subject:
Re: [perl #133558] perl 5.26: use lib pragma issue in IBM AIX
Message ID:
20181017142449.GB3102@iabyn.com
On Wed, Oct 17, 2018 at 03:39:08PM +0530, Gururaj Kallur wrote:
> After replacing the line, here is the output
> 
> -bash-4.2$ ./perl -Dq -le '@a = qw(/foo/bar); for (reverse @a) { print }'
> 
> CXt_LOOP_ARY:
> inc=-1; ix=0; fill=0
> inc>0: 0; ix>fill: 0; ix<0: 0
> /foo/bar
> 
> CXt_LOOP_ARY:
> inc=-1; ix=-1; fill=0
> inc>0: 0; ix>fill: 0; ix<0: 1
> goto retno

I've now pushed the following commit to blead. It is suitable for
packporting to any perl >= 5.24.

commit d6139ec4a9065ae249ab512398326a70dfb2fea2
Author:     David Mitchell <davem@iabyn.com>
AuthorDate: Wed Oct 17 15:10:10 2018 +0100
Commit:     David Mitchell <davem@iabyn.com>
CommitDate: Wed Oct 17 15:10:10 2018 +0100

    fix 'for reverse @array' bug on AIX
    
    RT #133558
    
    Due to what appears to be a compiler bug on AIX (or perhaps it's
    undefined behaviour which happens to work on other platforms), this line
    of code in pp_iter():
    
        inc = 1 - (PL_op->op_private & OPpITER_REVERSED);
    
    was setting inc to 4294967295 rather than to the expected -1 (inc was a
    64-bit signed long).
    
    Fix it with a couple of judicious (IV) casts (which ought to be a NOOP).


-- 
Technology is dominated by two types of people: those who understand what
they do not manage, and those who manage what they do not understand. 

Thread Previous | 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