From 28933dcdaa2389efa9e14e15aa141535f7da8f4f Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Sun, 23 Jun 2024 10:58:22 -0400 Subject: [PATCH] Within mi error message improvement --- src/compiler.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/compiler.jl b/src/compiler.jl index 3f57743cc0..1cb3066f88 100644 --- a/src/compiler.jl +++ b/src/compiler.jl @@ -2008,6 +2008,11 @@ function julia_error(cstr::Cstring, val::LLVM.API.LLVMValueRef, errtype::API.Err Base.show_backtrace(io, bt) println(io) end + pscope = parent_scope(val) + mi, rt = enzyme_custom_extract_mi(pscope, #=error=#false) + if mi !== nothing + println(io, "within ", mi) + end end emit_error(B, nothing, msg2) return C_NULL