]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4653: French beam ending on rest causes segfault
authorDavid Kastrup <dak@gnu.org>
Tue, 3 Nov 2015 12:36:54 +0000 (13:36 +0100)
committerDavid Kastrup <dak@gnu.org>
Tue, 10 Nov 2015 20:23:02 +0000 (21:23 +0100)
The issue here is that Stem::set-beaming may set one of the beaming
segment lists to #f instead of an empty list, and not all users of
"beaming" (in this case where_are_the_whole_beams) were prepared to
deal with this.

lily/beam.cc
lily/stem.cc
lily/tuplet-number.cc

index 206f6e9f4dfb4ff9f5a442f19596f80e17cef7e9..906483ed43c6500f87fd77c208b1913c95010d67 100644 (file)
@@ -259,7 +259,7 @@ position_with_maximal_common_beams (SCM left_beaming, SCM right_beaming,
       for (SCM s = scm_car (right_beaming); scm_is_pair (s); s = scm_cdr (s))
         {
           int k = -right_dir * scm_to_int (scm_car (s)) + i;
-          if (scm_is_true (scm_c_memq (scm_from_int (k), left_beaming)))
+          if (scm_is_true (ly_memv (scm_from_int (k), left_beaming)))
             count++;
         }
 
@@ -1006,7 +1006,7 @@ where_are_the_whole_beams (SCM beaming)
 
   for (SCM s = scm_car (beaming); scm_is_pair (s); s = scm_cdr (s))
     {
-      if (scm_is_true (scm_c_memq (scm_car (s), scm_cdr (beaming))))
+      if (scm_is_true (ly_memv (scm_car (s), scm_cdr (beaming))))
 
         l.add_point (scm_to_int (scm_car (s)));
     }
index 9cb84f57faa424b38df02d44e3086e06d6714629..f0335c58d2efe34bf06ce608a651f8f272c5f67f 100644 (file)
@@ -91,7 +91,7 @@ Stem::get_beaming (Grob *me, Direction d)
 
   SCM lst = index_get_cell (pair, d);
 
-  int len = scm_ilength (lst);
+  int len = scm_ilength (lst); // -1 for dotted lists!
   return max (len, 0);
 }
 
index 4d879ade4c46b37fb143339358a592b11e76971d..99e61b2ff55162d549bbf72b084029e071611df8 100644 (file)
@@ -336,7 +336,7 @@ count_beams_not_touching_stem (SCM beaming)
 
   for (SCM s = scm_car (beaming); scm_is_pair (s); s = scm_cdr (s))
     {
-      if (scm_is_true (scm_c_memq (scm_car (s), scm_cdr (beaming))))
+      if (scm_is_true (ly_memv (scm_car (s), scm_cdr (beaming))))
         ++count;
     }