From: David Kastrup Date: Tue, 3 Nov 2015 12:36:54 +0000 (+0100) Subject: Issue 4653: French beam ending on rest causes segfault X-Git-Tag: release/2.19.32-1~13^2~8 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=272e82d1174fdf303fcbbadc7648f75ac881ad3a;p=lilypond.git Issue 4653: French beam ending on rest causes segfault 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. --- diff --git a/lily/beam.cc b/lily/beam.cc index 206f6e9f4d..906483ed43 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -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))); } diff --git a/lily/stem.cc b/lily/stem.cc index 9cb84f57fa..f0335c58d2 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -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); } diff --git a/lily/tuplet-number.cc b/lily/tuplet-number.cc index 4d879ade4c..99e61b2ff5 100644 --- a/lily/tuplet-number.cc +++ b/lily/tuplet-number.cc @@ -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; }