From 5eb07c491b679bfb94d53acc28fa7aa1facafb9c Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Mon, 17 Oct 2016 09:57:53 -0400 Subject: [PATCH] Fix another IRBuilder InsertionPoint leak. Similar to #18054. Proper fix would be not to have a global builder. --- src/codegen.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/codegen.cpp b/src/codegen.cpp index 5a1bd54d7131d..01f1d57dcf660 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -3854,6 +3854,9 @@ static Function *gen_cfun_wrapper(jl_function_t *ff, jl_value_t *jlrettype, jl_t else builder.CreateRet(r); + builder.SetCurrentDebugLocation(noDbg); + builder.ClearInsertionPoint(); + jl_finalize_module(M, true); return cw_proto;