]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix ending the dynamic extent in Text_interface::interpret_markup
authorAntonio Ospite <ao2@ao2.it>
Wed, 9 Nov 2016 17:22:25 +0000 (18:22 +0100)
committerDavid Kastrup <dak@gnu.org>
Mon, 14 Nov 2016 15:33:38 +0000 (16:33 +0100)
When using cyclic references under guile-2.0 lilypond crashes with
a segmentation fault:

  $ LANG=C out/bin/lilypond input/regression/markup-cyclic-reference.ly
  GNU LilyPond 2.19.51
  Processing `input/regression/markup-cyclic-reference.ly'
  Parsing...
  Finding the ideal number of pages...
  Fitting music on 1 page...
  Drawing systems...
  Layout output to `/tmp/lilypond-wkUlSF'...
  Converting to `markup-cyclic-reference.pdf'...
  Deleting `/tmp/lilypond-wkUlSF'...
  Segmentation fault

This happens because in Text_interface::interpret_markup the dynamic
extent is not ended properly in the exit path for the case when the
markup depth exceeds the max_depth.

input/regression/markup-cyclic-reference.ly
lily/text-interface.cc

index 82bfe0641d0435c5f482aebf8df38dedf38e26b3..c0a952e3ea2ceb9b312f2df97e1fb53a340643be 100644 (file)
@@ -1,7 +1,7 @@
 \version "2.19.13"
 #(ly:set-option 'warning-as-error #f)
 #(ly:expect-warning (ly:translate-cpp-warning-scheme "Markup depth exceeds maximal value of %d; Markup: %s") 1024 'cycle-markup)
-#(ly:expect-warning (ly:translate-cpp-warning-scheme "Markup depth exceeds maximal value of %d; Markup: %s") 1024 'cycleI-markup)
+#(ly:expect-warning (ly:translate-cpp-warning-scheme "Markup depth exceeds maximal value of %d; Markup: %s") 1024 'cycleII-markup)
 
 \header {
   texidoc = "Cyclic markup definitions should cause a warning, but
index 4598246163af04abbab830d2e6bf23f0186aaa9a..d930cdaa372868622e4624883c4ace2f5539e2a9 100644 (file)
@@ -134,6 +134,7 @@ Text_interface::interpret_markup (SCM layout_smob, SCM props, SCM markup)
       scm_dynwind_unwind_handler (markup_down_depth, 0, SCM_F_WIND_EXPLICITLY);
       if (markup_depth > max_depth)
         {
+          scm_dynwind_end ();
           string name = ly_symbol2string (scm_procedure_name (func));
           // TODO: Also print the arguments of the markup!
           non_fatal_error (_f ("Markup depth exceeds maximal value of %d; "