Subject: Re: bug#75754: styled_format stack usage/GC protection

From: Eli Zaretskii <[email-masked]>
Date: Fri, 24 Jan 2025 09:41:47 +0200

> Date: Thu, 23 Jan 2025 22:37:43 +0000
> From: Pip Cet <[email-masked]>
> Cc: [email-masked], [email-masked]
> 
> "Eli Zaretskii" <[email-masked]> writes:
> 
> > What did I miss?
> 
> Can we make this a new bug?

We could, or we could keep discussing that in this bug (since this is
still about styled_format).

> This one is SDATA, not SAFE_ALLOCA.
> 
> diff --git a/src/editfns.c b/src/editfns.c
> index 4ba356d627c..23a5f9aeac6 100644
> --- a/src/editfns.c
> +++ b/src/editfns.c
> @@ -3491,7 +3491,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
>    /* If we start out planning a unibyte result,
>       then discover it has to be multibyte, we jump back to retry.  */
>   retry:
> -
> +  format_start = SSDATA (args[0]);
>    p = buf;
>    nchars = 0;
>  
> 
> should fix it.

Didn't try it yet, since we are still discussing what to do.  But I
would like to install the test, for now as expected to fail.  WDYT?