GNU bug report logs - #29520
peval leaves behind dangling lexical reference

Previous Next

Package: guile;

Reported by: Stefan Israelsson Tampe <stefan.itampe <at> gmail.com>

Date: Fri, 1 Dec 2017 16:19:02 UTC

Severity: normal

Done: Mark H Weaver <mhw <at> netris.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Mark H Weaver <mhw <at> netris.org>
To: Stefan Israelsson Tampe <stefan.itampe <at> gmail.com>
Cc: 29520 <at> debbugs.gnu.org
Subject: bug#29520: peval leaves behind dangling lexical reference
Date: Mon, 04 Dec 2017 16:10:00 -0500
Mark H Weaver <mhw <at> netris.org> writes:

> Mark H Weaver <mhw <at> netris.org> 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




This bug report was last modified 7 years and 132 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.