lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Uses derived_mark to avoid segfault (issue 5729051)


From: dak
Subject: Re: Uses derived_mark to avoid segfault (issue 5729051)
Date: Tue, 06 Mar 2012 12:19:04 +0000


http://codereview.appspot.com/5729051/diff/6001/lily/span-bar-stub-engraver.cc
File lily/span-bar-stub-engraver.cc (right):

http://codereview.appspot.com/5729051/diff/6001/lily/span-bar-stub-engraver.cc#newcode93
lily/span-bar-stub-engraver.cc:93: if (!scm_is_pair (axis_groups_) ||
!scm_is_pair (scm_car (axis_groups_)))
I'd remove the second check here.  The first check makes sure that we
have got data to operate on (so it checks the overall algorithmic
consistency), but the second check just checks that the data is of the
form we actually put in here, and since it is private data, nobody could
have changed it but ourselves.  It is a test of the
if (1 == 0) cerr << "Your compiler or CPU is broken";
variety.  Even if it triggered, the error message would not fit the
problem.

http://codereview.appspot.com/5729051/diff/6001/lily/span-bar-stub-engraver.cc#newcode160
lily/span-bar-stub-engraver.cc:160: // removes all unused contexts
On 2012/03/04 10:47:17, Neil Puttock wrote:
Is it feasible to listen for RemoveContext instead?  At least then you
only need
to rebuild axis_groups_ when contexts die.

I'd second this suggestion.  It should give more reliable lifetimes, and
also cause a better correlation of "parsed object should be dead"
messages with realities.

http://codereview.appspot.com/5729051/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]