GNU bug report logs - #24171
25.1; Bytecode returns nil instead of expected closure

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Sat, 6 Aug 2016 23:23:02 UTC

Severity: normal

Found in version 25.1

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 24171 <at> debbugs.gnu.org, Alex Vong <alexvong1995 <at> gmail.com>
Subject: bug#24171: 25.1; Bytecode returns nil instead of expected closure
Date: Sun, 07 Aug 2016 10:44:31 -0400
> (defun test ()
>   (let ((my-cool-fun 'dummy))
>     (let ((my-cool-fun
>            (let ((calculate (lambda () 1)))
>              (lambda () (setq my-cool-fun calculate))))
>           (return-my-cool-fun (lambda () my-cool-fun)))
>       (funcall my-cool-fun)
>       (funcall return-my-cool-fun))))

Good catch.  It's a bug in cconv.el in the case where it decides to use
lambda-lifting.  It tries to handle such name-capture (search for "(when
(memq var new-extend)" in cconv.el to see where) but doesn't catch the
above case.

Don't have a fix yet.  For the above test case, you can circumvent the
bug by swapping the order of return-my-cool-fun and my-cool-fun in the
let binding.


        Stefan




This bug report was last modified 8 years and 340 days ago.

Previous Next


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