Paul Eggert <eggert@cs.ucla.edu> schrieb am Mi., 2. März 2016 um 19:54 Uhr:
On 03/01/2016 01:43 PM, Philipp Stephani wrote:
>
>
>     https://lists.gnu.org/archive/html/emacs-devel/2015-12/msg00871.html
>
>
> I think this patch can still be applied as-is, it just simplifies the
> code a bit without changing any behavior.

OK, thanks, I applied it to master, along with the attached followup
which cleans things up a bit more and removes unnecessary runtime checks.

Thanks. Why did you remove the checks? I think all of them are necessary and lead to undefined behavior if they are violated.
 

>
>
>     https://lists.gnu.org/archive/html/emacs-devel/2015-12/msg00881.html
>
>     https://lists.gnu.org/archive/html/emacs-devel/2015-12/msg00902.html
>
>
> The second one is newer, so the first one should be discarded in favor
> of the second one. Given the decision to allow longjmp on segfault, it
> is no longer correct, but a variant (replacing "non-local exits" with
> "non-local exits due to Lisp `signal' and `throw'") should still be
> correct and useful.

This one looks more dubious. As I mentioned in the containing thread,
the comments are somewhat distracting where they are. Perhaps they could
be collected together into a comment in emacs-module.c that summarizes
the assumptions it makes.


The issue with that approach is that if one of the used functions is changed to throw signals, then the change author might not know to update emacs-module.c. In the worst case, for every function that starts throwing signals emacs-module.c would have to be investigated. It's less fragile to document the requirements in the functions themselves.