chicken-hackers
[Top][All Lists]
Advanced

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

[Chicken-hackers] [PATCH] Lists may be modified into pairs, but if they


From: Peter Bex
Subject: [Chicken-hackers] [PATCH] Lists may be modified into pairs, but if they are empty they aren't pairs to begin with. [was: Re: [PATCH] smash "list"/"list-of" types]
Date: Sun, 22 Apr 2012 17:45:22 +0200
User-agent: Mutt/1.4.2.3i

On Sat, Apr 21, 2012 at 03:56:22PM +0200, Felix wrote:
> The attached patch fixes a bug in the specialization machinery where
> "list" and "list-of" types are incorrectly retained for local bindings,
> even when a procedure call may potentially convert a proper list into
> an improper one. Found by Peter, fixes bug #803.

This patch introduces a subtle problem that can be seen by compiling
Chicken and installing it, then "touch files.scm" and compiling again,
then installing that.

While compiling files.scm, it will show a warning about a null? check
that's always false and the tests will fail on tests/path-tests.scm
because an empty list is always considered to be a pair.

The attached patch seems to fix it, but I'm not 100% sure it's the
correct fix.  Felix, what do you think?

I tried to create a regression test for this, but I wasn't able to come
up with anything that actually triggered the bug.  I did find a different
thing that's probably an unrelated bug, which I'm currently looking into.

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth

Attachment: null-check.patch
Description: Text document


reply via email to

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