Re: [PATCH] gcc/jit/jit-recording.cc: recording::global::write_to_dump: Avoid crashes when writing psuedo-C for globals with string initializers.

2023-10-25 Thread David Malcolm
On Fri, 2022-11-25 at 02:13 +0530, Vibhav Pant via Jit wrote: > If a char * global was initialized with a rvalue from > `gcc_jit_context_new_string_literal` containing a format string, > dumping the context causes libgccjit to SIGSEGV due to an improperly > constructed call to vasprintf. The

[PATCH] gcc/jit/jit-recording.cc: recording::global::write_to_dump: Avoid crashes when writing psuedo-C for globals with string initializers.

2022-11-24 Thread Vibhav Pant via Gcc-patches
If a char * global was initialized with a rvalue from `gcc_jit_context_new_string_literal` containing a format string, dumping the context causes libgccjit to SIGSEGV due to an improperly constructed call to vasprintf. The following code snippet can reproduce the crash: int main(int argc, char