GNU bug report logs - #65796
dynamic module non_local_exit_get overwrites exit signals

Previous Next

Package: emacs;

Reported by: Xinyang Chen <chenxinyang99 <at> gmail.com>

Date: Thu, 7 Sep 2023 04:59:01 UTC

Severity: normal

Tags: patch

Done: Philipp Stephani <p.stephani2 <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Xinyang Chen <chenxinyang99 <at> gmail.com>, Philipp Stephani <phst <at> google.com>, Daniel Colascione <dancol <at> dancol.org>
Cc: 65796 <at> debbugs.gnu.org
Subject: bug#65796: dynamic module non_local_exit_get overwrites exit signals
Date: Thu, 07 Sep 2023 10:07:33 +0300
> From: Xinyang Chen <chenxinyang99 <at> gmail.com>
> Date: Wed, 6 Sep 2023 18:52:14 -0400
> 
> Currently `module_non_local_exit_get` returns pointers to fields
> in emacs_env_private:
> ```
>   if (p->pending_non_local_exit != emacs_funcall_exit_return)
>     {
>       *symbol = &p->non_local_exit_symbol;
>       *data = &p->non_local_exit_data;
>     }
> ```
> this means that if one tries to:
> ```
> funcall(...);
> non_local_exit_get(&s1, &d1);
> funcall(...);
> non_local_exit_get(&s2, &d2);
> non_local_exit_signal(s1, d1);
> ```
> you would signal the second error, instead of the first error (I expected
> this to happen).
> It seems to me that `module_non_local_exit_get` should
> `allocate_emacs_value` instead.

Philipp, Daniel: any comments?

Btw, the non_local_exit_get function is currently not documented in
the ELisp manual; should it be?




This bug report was last modified 86 days ago.

Previous Next


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