Hi Han-Wen,

Thank you for pointing out this defect.
I have created patch 4236027 to address it:
http://codereview.appspot.com/4236047

To answer your question, what the "if" was supposed to be doing: the idea was to guard against the situation where there the whole paragraph consists of only one line, because a one-line paragraph is allowed to be orphaned. But what I was not seeing, was that the increment-statement of the "for" had already advanced "list" to point to EOL by the time we reached that "if". Quite embarrassing actually.

Boris

On 11-02-22 09:33 AM, Han-Wen Nienhuys wrote:
Hi Boris,

I was looking at why

   \markuplines{}

is dumping core, and came across code committed in

commit 4878fcdb04b335041f1440c8d31b0b4b80ecaea9
Author: Boris Shingarov<shinga...@gmail.com>

   Prob *ps;
   SCM list;
   for (list = texts ; scm_is_pair (list) ; list = scm_cdr (list))
             ...
    if (list == texts)
            {


complaints:

1. this code leaves ps and list uninitialized. Always initialize *all*
local variables.

2. the if never fires, unless tests==SCM_EOL in the first place

3. Given that the if never fires, do we have a regression test that
covers this code,  and are you sure this actually does something
useful?

Can you please fix this, both the esthetics and the functionality; it
is a release blocking problem.



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

Reply via email to