On Mon, Apr 4, 2011 at 12:22 AM, Werner LEMBERG <[email protected]> wrote: > >> LilyPond exposes large parts of the internal implementation through >> the Scheme interface, and that has as a side-effect that there are >> many ways for users to break lilypond. This is unlikely to lead to >> arbitrary behavior, as Guile values themselves themselves are type >> tagged. The worst which can happen is that a value is incorrectly >> type-cast which leads to either a null dereference or some other >> type assertion. > > Could you give a Scheme example for that, please?
Typical examples: * scm_cdr(SCM_EOL) This basically dereferences an (almost) null pointer. Possibly, this crashes neatly in debug mode (I'm not sure). The SCM_CDR() variant will surely crash with segmentation fault. * unsmob_grob(x)->foo() If x is not a grob, unsmob_grob(x) returns NULL. Boom. >> I don't think it is productive to try to systematically plug all >> these errors; at best, you'll replace a bunch of segmentation faults >> with just as unhelpful assertion failures. > > I definitely prefer assertions to segfaults. But maybe that's only > me. It does not make any difference: you'll need to start up a debugger to figure what's going on in either case. -- Han-Wen Nienhuys - [email protected] - http://www.xs4all.nl/~hanwen _______________________________________________ lilypond-devel mailing list [email protected] http://lists.gnu.org/mailman/listinfo/lilypond-devel
