lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fix segfault with ambitus and ligature (Issue 1715) (issue4667055)


From: Carl . D . Sorensen
Subject: Fix segfault with ambitus and ligature (Issue 1715) (issue4667055)
Date: Sun, 03 Jul 2011 21:13:22 +0000

Reviewers: ,

Message:
Here is a proposed patch for fixing issue 1715.  It works by checking
for event-cause before acknowledging a notehead, thus ignoring
AmbitusNoteHeads

Description:
Fix segfault with ambitus and ligature (Issue 1715)
Check for an event-cause before acknowledging note_head.  This
prevents trying to make a ligature from the AmbitusNoteHeads.

Also includes regression test.

Please review this at http://codereview.appspot.com/4667055/

Affected files:
  A input/regression/ambitus-with-ligature.ly
  M lily/ligature-engraver.cc


Index: input/regression/ambitus-with-ligature.ly
diff --git a/input/regression/ambitus-with-ligature.ly b/input/regression/ambitus-with-ligature.ly
new file mode 100644
index 0000000000000000000000000000000000000000..49c1f27ab7d3afa0caa2693fd8f6fef5f3c2eb79
--- /dev/null
+++ b/input/regression/ambitus-with-ligature.ly
@@ -0,0 +1,29 @@
+\version "2.14"
+
+\header {
+  texidoc = "
+A @code{\Voice} should be able to contain both an @code{Ambitus_engraver}
+and a @code{Mensural_ligature_engraver} without segfaulting.
+  "
+}
+
+testnotes = {
+  \relative c' {
+ \[ c\longa c'\longa \] %This is a ligature; we are interpreting it as two whole notes
+  }
+}
+
+\score{
+  {
+    \context Staff="default" {
+      \testnotes
+    }
+  }
+  \layout {
+    \context{
+      \Voice
+      \consists Ambitus_engraver
+      \consists Mensural_ligature_engraver
+    }
+  }
+}
Index: lily/ligature-engraver.cc
diff --git a/lily/ligature-engraver.cc b/lily/ligature-engraver.cc
index be4917f0c735ec5da9078c875af32a0317ce35ea..756b7bbc7d44569ff873d77c5f89e1d45d7092ae 100644
--- a/lily/ligature-engraver.cc
+++ b/lily/ligature-engraver.cc
@@ -143,7 +143,7 @@ Ligature_engraver::process_music ()

       ligature_start_mom_ = now_mom ();

-      // TODO: dump cause into make_item/spanner.
+      // TODO: dump cause into make_item/spanner.
       // announce_grob (ligature_, events_drul_[START]->self_scm ());
     }
 }
@@ -196,14 +196,13 @@ Ligature_engraver::current_ligature ()
 void
 Ligature_engraver::acknowledge_note_head (Grob_info info)
 {
-  if (ligature_)
-    {
-      primitives_.push_back (info);
-      if (info.grob () && brew_ligature_primitive_proc != SCM_EOL)
-       {
+  if (info.event_cause ())
+    if (ligature_)
+      {
+        primitives_.push_back (info);
+        if (info.grob () && brew_ligature_primitive_proc != SCM_EOL)
          info.grob ()->set_property ("stencil", brew_ligature_primitive_proc);
-       }
-    }
+      }
 }

 void





reply via email to

[Prev in Thread] Current Thread [Next in Thread]