From 356e117815a56a9a049d4d38b8b62698a2178506 Mon Sep 17 00:00:00 2001 From: Timo Paulssen Date: Thu, 9 Sep 2021 00:34:14 +0200 Subject: [PATCH] prevent perf map output from segfaulting --- src/jit/compile.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/jit/compile.c b/src/jit/compile.c index e749b7bacf..832b4668e8 100644 --- a/src/jit/compile.c +++ b/src/jit/compile.c @@ -138,8 +138,10 @@ MVMJitCode * MVM_jit_compile_graph(MVMThreadContext *tc, MVMJitGraph *jg) { #if linux /* Native Call compiles code that doesn't correspond - * to a staticframe, in which case we just skip this. */ - if (tc->instance->jit_perf_map && jg->sg->sf) { + * to a staticframe, in which case we just skip this. + * Sometimes code ends up null here as well, in which + * case we also skip. */ + if (tc->instance->jit_perf_map && jg->sg->sf && code) { MVMStaticFrame *sf = jg->sg->sf; char symbol_name[1024]; char *file_location = MVM_staticframe_file_location(tc, sf);