From 74f4ce6193d2e04bb4ee8ffb5d976e718a486801 Mon Sep 17 00:00:00 2001 From: Amaury Sechet Date: Fri, 15 Jan 2016 00:23:34 +0000 Subject: LLVMRunStaticConstructors can be called before object is finalized, #24028 Summary: Since you cannot call finalizeObject manually through the C-API and other functions from the C-API automatically call it, LLVMRunStaticConstructors should also call it or otherwise you cannot call it without first calling a workaround function (or call any other function from the C-API which implicitly finalizes the object). Reviewers: dnovillo, spatel, bkramer, deadalnix, joker.eph, echristo, lhames Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16188 llvm-svn: 257849 --- llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp') diff --git a/llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp b/llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp index ff7c4dce0d5..3b2eb16c024 100644 --- a/llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp +++ b/llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp @@ -215,10 +215,12 @@ void LLVMDisposeExecutionEngine(LLVMExecutionEngineRef EE) { } void LLVMRunStaticConstructors(LLVMExecutionEngineRef EE) { + unwrap(EE)->finalizeObject(); unwrap(EE)->runStaticConstructorsDestructors(false); } void LLVMRunStaticDestructors(LLVMExecutionEngineRef EE) { + unwrap(EE)->finalizeObject(); unwrap(EE)->runStaticConstructorsDestructors(true); } -- cgit v1.2.3