From: Eli Zaretskii <eliz@gnu.org>
To: Noam Postavsky <npostavs@gmail.com>
Cc: ynyaaa@gmail.com, 31549@debbugs.gnu.org
Subject: bug#31549: 25.3; bytecompile fails with eval-when-compile
Date: Thu, 24 May 2018 19:40:12 +0300 [thread overview]
Message-ID: <83fu2hatxv.fsf@gnu.org> (raw)
In-Reply-To: <87k1rugfxd.fsf@gmail.com> (message from Noam Postavsky on Wed, 23 May 2018 18:34:06 -0400)
> From: Noam Postavsky <npostavs@gmail.com>
> Cc: ynyaaa@gmail.com, 31549@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?
next prev parent reply other threads:[~2018-05-24 16:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-22 9:00 bug#31549: 25.3; bytecompile fails with eval-when-compile ynyaaa
2018-05-22 23:33 ` Noam Postavsky
2018-05-23 15:08 ` Eli Zaretskii
2018-05-23 22:34 ` Noam Postavsky
2018-05-24 16:40 ` Eli Zaretskii [this message]
2018-05-24 21:18 ` Noam Postavsky
2018-05-25 6:19 ` Eli Zaretskii
2018-05-27 15:09 ` Noam Postavsky
2018-05-27 16:22 ` Eli Zaretskii
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/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83fu2hatxv.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=31549@debbugs.gnu.org \
--cc=npostavs@gmail.com \
--cc=ynyaaa@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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).