From 122555fb66c3ab1ca55473289c683b7b8e016436 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sun, 26 Dec 2021 19:21:50 +0300 Subject: [PATCH] Add an error check in JITAnnouncer event listener This is a bit strange one. --- Utilities/JIT.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Utilities/JIT.cpp b/Utilities/JIT.cpp index b43e1fdd48..7029850d25 100644 --- a/Utilities/JIT.cpp +++ b/Utilities/JIT.cpp @@ -424,6 +424,14 @@ struct JITAnnouncer : llvm::JITEventListener using namespace llvm; object::OwningBinary debug_obj_ = info.getObjectForDebug(obj); + if (!debug_obj_.getBinary()) + { +#ifdef __linux__ + jit_log.error("LLVM: Failed to announce JIT events (no debug object)"); +#endif + return; + } + const object::ObjectFile& debug_obj = *debug_obj_.getBinary(); for (const auto& [sym, size] : computeSymbolSizes(debug_obj))