On Sun Mar 20 06:39:39 2016, elizabeth wrote: > ========================== > my $a = 14; > while (True) { > my $z = (2..13).first(-> $x { !($a %% $x) }); > last if (!$z); > $a += 14 > } > say $a > ========================== > > The above code “verbatim” segfaults on OS X and Linux on HEAD. > > Replacing either the (True) by True, or (!$z) by !$z, or adding an > additional say after the loop, will make the code succeed. > > > Looking at the output of —target=optimize between (!$z) and !$z, I see > only this significant difference: > > - - QAST::Op(callstatic &prefix:<!>) :BY<modifier_expr W> > :statement_id<?> :WANTED ! > + - QAST::Op(callstatic &prefix:<!>) :BY<modifier_expr W> :WANTED ! > > I would have sorta expected that the () would not make a difference > for the generated code at all, but apparently it does? > > Also, disabling spesh or JIT does not seem to make a difference. > > > In any case, I thought this would be a nice thing for the right > people. :-) > > Discussion at: http://irclog.perlgeek.de/perl6/2016-03-20#i_12212186 >
Was a GC invariant violation that occasionally led to memory corruption (thus why it was easy to make it vanish with silly changes). Actually a regression within the last month or two. Fixed it, and add a test to integration/weird-errors.t. /jnthn