[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#29520: peval leaves behind dangling lexical reference
From: |
Mark H Weaver |
Subject: |
bug#29520: peval leaves behind dangling lexical reference |
Date: |
Mon, 04 Dec 2017 16:10:00 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
Mark H Weaver <address@hidden> writes:
> Mark H Weaver <address@hidden> writes:
>
>> I believe the problem is most likely in 'lift-applied-lambda' in
>> peval.scm. When transforming:
>>
>> (lambda args (apply (lambda ...) args)) => (lambda ...)
>>
>> it does not appear to check whether 'args' is referenced within the
>> inner lambda.
It occurs to me that there's another problem with this optimization:
scheme@(guile-user)> ,optimize (lambda (x y . z) (apply (lambda x x) x y z))
$1 = (lambda x x)
This optimization changes the arity of the procedure. The original
version checks that at least 2 arguments are provided, and ensures that
at least 2 arguments are passed to the inner procedure, which the code
might depend on. The optimization effectively removes this check.
I'll look into how to fix this.
Mark