From: Andrea Corallo Date: Sun, 31 May 2020 11:22:46 +0000 (+0100) Subject: * Emit better debug comments in emit_static_object X-Git-Tag: emacs-28.0.90~2727^2~604 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5cf148cfef23b827629950048dab678f3b9af2d3;p=emacs.git * Emit better debug comments in emit_static_object * src/comp.c (emit_static_object): Do not truncate debug comments at the first NULL character. --- diff --git a/src/comp.c b/src/comp.c index d3bff1e4cfe..f288fc2551a 100644 --- a/src/comp.c +++ b/src/comp.c @@ -2392,8 +2392,15 @@ emit_static_object (const char *name, Lisp_Object obj) 0, NULL, 0); DECL_BLOCK (block, f); - /* NOTE this truncates if the data has some zero byte before termination. */ - gcc_jit_block_add_comment (block, NULL, p); + if (COMP_DEBUG > 1) + { + char *comment = memcpy (xmalloc (len), p, len); + for (ptrdiff_t i = 0; i < len - 1; i++) + if (!comment[i]) + comment[i] = '\n'; + gcc_jit_block_add_comment (block, NULL, comment); + xfree (comment); + } gcc_jit_lvalue *arr = gcc_jit_lvalue_access_field (data_struct, NULL, fields[1]);