GNU bug report logs - #31549
25.3; bytecompile fails with eval-when-compile

Previous Next

Package: emacs;

Reported by: ynyaaa <at> gmail.com

Date: Tue, 22 May 2018 09:02:01 UTC

Severity: minor

Found in version 25.3

Fixed in version 26.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Noam Postavsky <npostavs <at> gmail.com>
To: ynyaaa <at> gmail.com
Cc: 31549 <at> debbugs.gnu.org
Subject: bug#31549: 25.3; bytecompile fails with eval-when-compile
Date: Tue, 22 May 2018 19:33:03 -0400
ynyaaa <at> gmail.com writes:

> (byte-compile `(eval-when-compile (list ,@(make-list 2047 0))))
>
> Evaluating the form above, emacs (with -Q option) reports
>   Error: Memory exhausted--use C-x s then exit and restart Emacs
> in *Compile-Log* buffer.
> The returned value of the form is t.

The error is coming from exec_byte_code:

  if (MAX_ALLOCA / word_size <= XFASTINT (maxdepth))
    memory_full (SIZE_MAX);

It's more like a Lisp stack overflow than a memory exhausted situation
though, hardly calls for restarting Emacs.  Perhaps the byte compiler
should refuse to compile such a large expression?

I can't reproduce in Emacs 26, but only because MAX_ALLOCA is bigger, I
think.








This bug report was last modified 6 years and 363 days ago.

Previous Next


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