[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH] Lists may be modified into pairs, but if t
Re: [Chicken-hackers] [PATCH] Lists may be modified into pairs, but if they are empty they aren't pairs to begin with.
Tue, 24 Apr 2012 09:15:23 +0200 (CEST)
From: Peter Bex <address@hidden>
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
Date: Sun, 22 Apr 2012 17:45:22 +0200
> 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?
Good catch - this is indeed correct. The operation that triggers the
smashing will not necessarily mutate the list so it may still be a list
and thus also null. Applied.
> 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.
Sometimes "compiler-typecase" is useful for provoking type matches.