David Kastrup <d...@gnu.org> writes:

> Mamoru TASAKA <mtas...@fedoraproject.org> writes:
>
>> And the attached proposal patch should fix this issue. Please review this.
>
> Well spotted but this patch is butt-ugly by calculating a nonsense
> reference in the troublesome case that is then being ignored.
>
> Since neighbor_seg is not even getting used more than twice and that in
> the same expression, I'd just write out segs[j + event_dir] instead and
> let the optimizer do the rest.  The problematic expression is then not
> even generated because of short-circuit evaluation.

I put up a different patch for review.

Tracker issue: 5320 (https://sourceforge.net/p/testlilyissues/issues/5320/)
Rietveld issue: 343160043 (https://codereview.appspot.com/343160043)
Issue description:
  beam.cc: avoid calculating an invalid reference  In
  calc_beam_segments, an invalid reference to a neighboring segment
  was calculated (and not used) at the extreme ends of the beam.  This
  caused segfaults on Fedora.  Since the reference is used at most
  twice anyway and in the same expression, it seems easier to just use
  the expression directly (the invalid cases are then skipped due to
  short-circuit evaluation).

Bug squad?  It might make sense to attach references to the reports in
the mailing list archives to this issue.

-- 
David Kastrup

_______________________________________________
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond

Reply via email to