<HTML><BODY><div>Hi, Igor!</div><div>Thanks for the patch!</div><div>LGTM, except for the nits mentioned by Sergey.</div><div data-signature-widget="container"><div data-signature-widget="content"><div>--<br>Best regards,</div><div>Maxim Kokryashkin</div></div></div><div> </div><div> </div><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">Понедельник, 13 февраля 2023, 20:03 +03:00 от Igor Munkin <imun@tarantool.org>:<br> <div id=""><div class="js-helper js-readmsg-msg"><div><div id="style_16763078090418014199_BODY">struct GCtrace is defined only if LJ_HASJIT is set. Hence all spots<br>where GCtrace is used should be also moved under LJ_HASJIT define.<br><br>Relates to tarantool/tarantool#8252<br><br>Signed-off-by: Igor Munkin <<a href="/compose?To=imun@tarantool.org">imun@tarantool.org</a>><br>---<br> src/lj_memprof.c | 9 ++++-----<br> src/lj_symtab.c | 13 +++----------<br> src/lj_symtab.h | 2 ++<br> 3 files changed, 9 insertions(+), 15 deletions(-)<br><br>diff --git a/src/lj_memprof.c b/src/lj_memprof.c<br>index d4a639fd..8cab8204 100644<br>--- a/src/lj_memprof.c<br>+++ b/src/lj_memprof.c<br>@@ -369,6 +369,8 @@ void lj_memprof_add_proto(const struct GCproto *pt)<br> lj_symtab_dump_proto(&mp->out, pt);<br> }<br> <br>+#if LJ_HASJIT<br>+<br> void lj_memprof_add_trace(const struct GCtrace *tr)<br> {<br> struct memprof *mp = &memprof;<br>@@ -380,6 +382,8 @@ void lj_memprof_add_trace(const struct GCtrace *tr)<br> lj_symtab_dump_trace(&mp->out, tr);<br> }<br> <br>+#endif /* LJ_HASJIT */<br>+<br> #else /* LJ_HASMEMPROF */<br> <br> int lj_memprof_start(struct lua_State *L, const struct lj_memprof_options *opt)<br>@@ -401,9 +405,4 @@ void lj_memprof_add_proto(const struct GCproto *pt)<br> UNUSED(pt);<br> }<br> <br>-void lj_memprof_add_trace(const struct GCtrace *tr)<br>-{<br>- UNUSED(tr);<br>-}<br>-<br> #endif /* LJ_HASMEMPROF */<br>diff --git a/src/lj_symtab.c b/src/lj_symtab.c<br>index 91ee9a72..54984c05 100644<br>--- a/src/lj_symtab.c<br>+++ b/src/lj_symtab.c<br>@@ -53,16 +53,7 @@ void lj_symtab_dump_trace(struct lj_wbuf *out, const GCtrace *trace)<br> lj_wbuf_addu64(out, (uint64_t)lineno);<br> }<br> <br>-#else<br>-<br>-static void lj_symtab_dump_trace(struct lj_wbuf *out, const GCtrace *trace)<br>-{<br>- UNUSED(out);<br>- UNUSED(trace);<br>- lua_assert(0);<br>-}<br>-<br>-#endif<br>+#endif /* LJ_HASJIT */<br> <br> void lj_symtab_dump_proto(struct lj_wbuf *out, const GCproto *pt)<br> {<br>@@ -491,11 +482,13 @@ void lj_symtab_dump(struct lj_wbuf *out, const struct global_State *g,<br> lj_symtab_dump_proto(out, pt);<br> break;<br> }<br>+#if LJ_HASJIT<br> case (~LJ_TTRACE): {<br> lj_wbuf_addbyte(out, SYMTAB_TRACE);<br> lj_symtab_dump_trace(out, gco2trace(o));<br> break;<br> }<br>+#endif /* LJ_HASJIT */<br> default:<br> break;<br> }<br>diff --git a/src/lj_symtab.h b/src/lj_symtab.h<br>index 6faa5cb1..6ec0cd7c 100644<br>--- a/src/lj_symtab.h<br>+++ b/src/lj_symtab.h<br>@@ -60,10 +60,12 @@<br> #define SYMTAB_TRACE ((uint8_t)2)<br> #define SYMTAB_FINAL ((uint8_t)0x80)<br> <br>+#if LJ_HASJIT<br> /*<br> ** Dumps traceinfo into the symbol table.<br> */<br> void lj_symtab_dump_trace(struct lj_wbuf *out, const GCtrace *trace);<br>+#endif /* LJ_HASJIT */<br> <br> /*<br> ** Dumps function prototype.<br>--<br>2.30.2</div></div></div></div></blockquote><div> </div></BODY></HTML>