[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fix crash when unknown grob name is passed to ly:engraver-make-grob
From: |
dak |
Subject: |
Re: Fix crash when unknown grob name is passed to ly:engraver-make-grob (issue 5715053) |
Date: |
Tue, 20 Mar 2012 23:29:55 +0000 |
http://codereview.appspot.com/5715053/diff/2001/lily/engraver-scheme.cc
File lily/engraver-scheme.cc (right):
http://codereview.appspot.com/5715053/diff/2001/lily/engraver-scheme.cc#newcode42
lily/engraver-scheme.cc:42: programming_error ("cannot create grob");
This gives no helpful indication of where the error occured, and
triggers problems later in unrelated code. That's not better than a
segfault: neither is better than "something that shouldn't happened
somewhere".
You could check whether "cause" is a grob in which case you can call
unsmob_grob (cause)->programming_error on it in order to give the error
message a _source_ indicator, or a stream-event in which case
unsmob_event (cause)->origin ()->programming_error would deliver a
suitable source indicator for the error.
http://codereview.appspot.com/5715053/