Subject: bug#75648: Minor safety improvements to fns.c/eval.c

From: Michael Albinus <[email-masked]>
Date: Sat, 18 Jan 2025 17:25:18 +0100

Eli Zaretskii <[email-masked]> writes:

Hi,

>> Patch 1 adds :crash tests to ert.el.
>
> Hmm... maybe this should be discussed separately, as it's a much
> broader issue.  Can you provide the motivation, both for the new macro
> (which is basically a one-liner), and for the new tag?

This patch adds the :crash tag to ert.el. This is unfortune. Until now,
there are no predefined tags in ert.el. Do we want to change this?

If we need such a property for ert tests, we should use another
mechanism. For example, another slot in the defstruct ert-test, like
(should-not-crash nil). And your new macro should-not-crash sets this
slot to non-nil in its scope. With this, you can even declare more
precisely, which parts of your ert deftest shall be protected.

Furthermore, IIUC, your new macro succedds always if the form doesn't
crash. So we have no information, whether the form returns nil, non-nil,
or an error, in case it doesn't crash. I would still like to see the
test result from should-not-crash in this case.

Best regards, Michael.