On 8/16/11 11:15 PM, "Dan Eble" <d...@faithful.be> wrote:

> I think the following code should check that ev is not null before
> dereferencing it.  This might be a factor in a segfault I saw.  (Sorry to be
> so vague, but I am not going to build lilypond to test the theory.  It would
> take a credible threat of violence to change my mind.)  A grep suggests that
> there may be other similar cases.
> 
> void
> Dispatcher::dispatch (SCM sev)
> {
>   Stream_event *ev = unsmob_stream_event (sev);
>   SCM class_symbol = ev->get_property ("class");

Certainly there would be a segfault if sev is null.  And perhaps this is the
best place to check for it.  But this would not be the best place to place a
warning and handle the null sev, because there is no context for how the
null sev got in the call.

Do you have more information about the segfault that you'd be willing to
share with us?

Thanks,

Carl


_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to