unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
Cc: 29520@debbugs.gnu.org
Subject: bug#29520: peval leaves behind dangling lexical reference
Date: Mon, 04 Dec 2017 16:10:00 -0500	[thread overview]
Message-ID: <87wp22w66v.fsf@netris.org> (raw)
In-Reply-To: <878tejxd76.fsf@netris.org> (Mark H. Weaver's message of "Mon, 04 Dec 2017 00:41:01 -0500")

Mark H Weaver <mhw@netris.org> writes:

> Mark H Weaver <mhw@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





  reply	other threads:[~2017-12-04 21:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-01 12:08 bug#29520: Compilation error Stefan Israelsson Tampe
2017-12-03 22:05 ` bug#29520: peval leaves behind dangling lexical reference Mark H Weaver
2017-12-04  0:43   ` Mark H Weaver
2017-12-04  5:41     ` Mark H Weaver
2017-12-04 21:10       ` Mark H Weaver [this message]
2017-12-05  2:55         ` Mark H Weaver
2018-03-16  3:41           ` Mark H Weaver

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wp22w66v.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=29520@debbugs.gnu.org \
    --cc=stefan.itampe@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).