From b78489625e949d54ef2c7b2f236576049e80a464 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Tue, 10 Sep 2013 11:34:02 +0200 Subject: [PATCH] Avoid undefined behavior after "music expected" error This problem was introduced in 2.17.4 by an oversight in issue 2862. --- lily/parser.yy | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lily/parser.yy b/lily/parser.yy index b54191d839..fcde23ac9d 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -1063,7 +1063,10 @@ music_arg: { $$ = make_music_from_simple (parser, @1, $1); if (!unsmob_music ($$)) + { parser->parser_error (@1, _ ("music expected")); + $$ = MAKE_SYNTAX ("void-music", @$); + } } | composite_music %prec COMPOSITE ; @@ -2472,7 +2475,10 @@ event_chord: unsmob_music ($$)->set_property ("articulations", scm_reverse_x ($2, SCM_EOL)); else + { parser->parser_error (@1, _("music expected")); + $$ = MAKE_SYNTAX ("void-music", @1); + } } } | simple_chord_elements post_events { -- 2.39.5