lilypond-devel
[Top][All Lists]
Advanced

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

Re: crash while processing lily-7d242e8d.ly


From: Carl D. Sorensen
Subject: Re: crash while processing lily-7d242e8d.ly
Date: Fri, 1 May 2009 16:35:09 -0600



On 5/1/09 2:52 PM, "Neil Puttock" <address@hidden> wrote:

> 2009/5/1 Patrick McCarty <address@hidden>:
> 
>> It's a judgment call, but I think you would be the best candidate for
>> fixing it, since you have recently looked at this code.
> 
> Hehe. :)
> 
> The less diplomatic answer:
> 
> You should fix it because your patch broke ly:error.

Of course.  But my patch also fixed ly:error.  It's just that the way
ly:error broke before didn't cause a segfault.  I'm not quibbling with the
need to fix the problem, and I will fix it.


> 
> You could of course use an extra scm_is_pair to check whether REST is
> null, but I think it would be better to remove the extra code
> completely and instead extract each argument from the markup error
> message.

It seems to me that there are three cases:

1) rest is null -- the old code worked.

2) rest is a single argument -- the old code worked.

3) rest is a list -- the old code failed, and gave a totally weird error
message.

So I fixed case 3, and case 2 still worked (I tested it in my code), but I
apparently broke case 1.

Why is it not appropriate to do:

if (! scm_is_null (rest))
  if  (scm_is_pair (rest))
     rest = scm_car(rest);

This seems to handle all three cases appropriately.

Carl






reply via email to

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