GNU bug report logs -
#31549
25.3; bytecompile fails with eval-when-compile
Previous Next
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
Message #19 received at 31549 <at> debbugs.gnu.org (full text, mbox):
> From: Noam Postavsky <npostavs <at> gmail.com>
> Cc: ynyaaa <at> gmail.com, 31549 <at> debbugs.gnu.org
> Date: Wed, 23 May 2018 18:34:06 -0400
>
> > How about simply signaling a special error instead of memory_full?
> > Something like
> >
> > error ("Lisp stack overflow");
>
> Still might be worth considering changing the error, although stack
> overflow doesn't describe it correctly anymore. As far as I can tell,
> SAFE_ALLOCA_LISP_EXTRA will only signal memory_full if the number of
> bytes to allocate won't fit in a ptrdiff_t variable. That should be
> pretty much impossible, barring some strange bugs. So maybe:
>
> --- i/src/lisp.h
> +++ w/src/lisp.h
> @@ -4662,7 +4662,7 @@ egetenv (const char *var)
> if (INT_MULTIPLY_WRAPV (nelt, word_size, &alloca_nbytes) \
> || INT_ADD_WRAPV (alloca_nbytes, extra, &alloca_nbytes) \
> || SIZE_MAX < alloca_nbytes) \
> - memory_full (SIZE_MAX); \
> + error ("Oversize allocation (0x%lX)", (size_t) alloca_nbytes); \
> else if (alloca_nbytes <= sa_avail) \
> (buf) = AVAIL_ALLOCA (alloca_nbytes); \
> else \
I agree that memory_full is suboptimal here, but "Oversize allocation"
with a number is too technical to be useful to the programmer who
bumps into this problem. We need some text which will indicate that
the program is too "complex" (a better word is needed here) and should
be simplified. Can you come up with something along those lines?
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.