develooper Front page | perl.perl5.porters | Postings from September 2016

[perl #129196] Segmentation fault: "evalbytes S"

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
September 5, 2016 15:56
Subject:
[perl #129196] Segmentation fault: "evalbytes S"
Message ID:
rt-4.0.24-4522-1473090977-724.129196-15-0@perl.org
On Mon Sep 05 07:59:34 2016, davem wrote:
> On Mon, Sep 05, 2016 at 02:48:40PM +0100, Dagfinn Ilmari Mannsåker
> wrote:
> > Dave Mitchell <davem@iabyn.com> writes:
> >
> > > On Sun, Sep 04, 2016 at 09:30:44PM -0700, Father Chrysostomos via
> > > RT wrote:
> > > Around the time this commit was pushed, win32 smokers and Jenkins
> > > have
> > > been failing to compile, with
> > >
> > > ..\toke.c(7586) : error C2105: '--' needs l-value
> > >
> > > However, your commit doesn't touch the affected area of code, which
> > > hasn't
> > > changed since 2011:
> > >
> > > 7584:       case KEY_evalbytes:
> > > 7585:           PL_expect = XTERM;
> > > 7586:           UNIBRACK(-OP_ENTEREVAL);
> > >
> > > The error would seem to imply that OP_ENTEREVAL has been defined to
> > > a
> > > negative value, but it's been 345 in opnames.h for a month now.
> > >
> > > So I can't see what the problem is.
> >
> > UNIBRACK(f) is defined as UNIUNI3(f,0,0), which as of 9bde5622 does
> >
> > PL_last_lop_op = f < 0 ? -f : f;
> >
> > So this expands to '-345 < 0 ? --345 : -345'.  Changing it to '-(f)'
> > (and '(f)', for consistency) shold fix it.
> 
> I've just done that as v5.25.4-84-g0af40c7
> 
> On Mon, Sep 05, 2016 at 02:55:25PM +0100, Zefram wrote:
> > Dave Mitchell wrote:
> > > ..\toke.c(7586) : error C2105: '--' needs l-value
> > ...
> > > 7586:            UNIBRACK(-OP_ENTEREVAL);
> > >
> > > The error would seem to imply that OP_ENTEREVAL has been defined to
> > > a
> > > negative value,
> >
> > That's not how the C preprocessor works.  Macro expansion can't paste
> > two adjacent "-" tokens into a "--".  In any case, the OP_ values
> > have
> > never been negative.
> 
> I guess that's a bug in the win C compiler? Which would explain why
> the
> problem hasn't surfaced on other platforms.

I see you have beaten me to fixing it in 0af40c757f0.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: pending release
https://rt.perl.org/Ticket/Display.html?id=129196

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