Menu

#5320 beam.cc: avoid calculating an invalid reference

Fixed
Crash
2018-05-17
2018-05-09
No

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).

http://codereview.appspot.com/343160043

Discussion

  • Mamoru TASAKA

    Mamoru TASAKA - 2018-05-09

    Perhaps I don't have right to review patch on codereview site, however patch looks good to me.

     
  • Anonymous

    Anonymous - 2018-05-10
    • Description has changed:

    Diff:

    
    
    • Needs: -->
    • Patch: new --> review
     
  • Anonymous

    Anonymous - 2018-05-10

    Passes make, make check and a full make doc

     
  • Anonymous

    Anonymous - 2018-05-13
    • Patch: review --> countdown
     
  • Anonymous

    Anonymous - 2018-05-13

    Patch on countdown for May 16th

     
  • Anonymous

    Anonymous - 2018-05-17
    • Patch: countdown --> push
     
  • Anonymous

    Anonymous - 2018-05-17

    Patch counted down - please push

     
  • David Kastrup

    David Kastrup - 2018-05-17
    • labels: --> Fixed_2_21_0
    • status: Started --> Fixed
    • Patch: push -->
    • Type: Enhancement --> Crash
     
  • David Kastrup

    David Kastrup - 2018-05-17

    Pushed to staging as
    commit d63756608d265d7a99444af1123b7be8a06f3cc2
    Author: David Kastrup dak@gnu.org
    Date: Wed May 9 13:48:35 2018 +0200

    Issue 5320: 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).
    
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.