From: David Kastrup Date: Tue, 10 Sep 2013 09:34:02 +0000 (+0200) Subject: Avoid undefined behavior after "music expected" error X-Git-Tag: release/2.17.95-1~4^2~18 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b78489625e949d54ef2c7b2f236576049e80a464;p=lilypond.git Avoid undefined behavior after "music expected" error This problem was introduced in 2.17.4 by an oversight in issue 2862. --- 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 {