From 4fda39cb1670106eac8b912a77d03586eafc18a2 Mon Sep 17 00:00:00 2001 From: Pip Cet Date: Wed, 22 Jan 2025 18:01:47 +0000 Subject: [PATCH] [MPS] Temporarily scan SAFE_ALLOCA'd memory (bug#75754) This is not a permanent solution, and requires statement expressions. * src/lisp.h (SAFE_ALLOCA): Define in terms of SAFE_NALLOCA, which already uses this workaround. --- src/lisp.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lisp.h b/src/lisp.h index 35a589acdc5..d9c238d990a 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -6122,6 +6122,17 @@ void igc_xfree (void *p); } \ } while (false) +/* Temporarily avoid bug#75754. The code above is painstakingly written + to avoid statement expressions; no easy way to do that in this case, + unfortunately. + + FIXME/igc: find a permanent fix for these bugs. */ +#undef SAFE_ALLOCA +#define SAFE_ALLOCA(size) \ + ({ void *buf; \ + SAFE_NALLOCA (buf, size, 1); \ + buf; }) + #endif /* SAFE_ALLOCA_STRING allocates a C copy of a Lisp string. */