Subject: bug#46824: 28.0.50; nativecomp crash with cl-block/cl-defun

From: Eli Zaretskii <[email-masked]>
Date: Tue, 02 Mar 2021 15:27:54 +0200

> From: Pip Cet <[email-masked]>
> Date: Tue, 2 Mar 2021 09:16:12 +0000
> Cc: [email-masked], Aaron Jensen <[email-masked]>
> 
> +  gcc_jit_param *params[] =
> +    {
> +      gcc_jit_context_new_param (comp.ctxt, NULL, comp.void_ptr_type, "buf"),
> +    };

Nitpicking: the braces here should be in column zero.

> +  /* Don't call setjmp through a function pointer (Bug#46824) */
> +  return gcc_jit_context_new_call (comp.ctxt,
> +				   NULL,
> +				   gcc_jit_context_new_function
> +				   (comp.ctxt, NULL, GCC_JIT_FUNCTION_IMPORTED,
> +				    comp.int_type, STR (SETJMP_NAME),
> +				    ARRAYELTS (params), params,
> +				    false),
> +				   1,
> +				   args);

Another nit: in cases like this one I find this style more readable:

  return gcc_jit_context_new_call (comp.ctxt, NULL,
  	 			   gcc_jit_context_new_function (comp.ctxt, 
				   				 NULL, 
								 GCC_JIT_FUNCTION_IMPORTED,
								 ...

IOW, avoid having the function's name and its arguments on separate
lines, as I find that harder to read.

Or maybe even this:

  gcc_jit_rvalue *val =
    gcc_jit_context_new_call (comp.ctxt, NULL,
    			      gcc_jit_context_new_function (comp.ctxt, NULL,
			      				    GCC_JIT_FUNCTION_IMPORTED,
							    ...),
			      1, args);
  return val;

However, since this is my personal preference, I won't insist if you
find your style preferable.

Thanks.