[llvm] r257849 - LLVMRunStaticConstructors can be called before object is finalized, #24028

Amaury Sechet via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 14 16:23:34 PST 2016


Author: deadalnix
Date: Thu Jan 14 18:23:34 2016
New Revision: 257849

URL: http://llvm.org/viewvc/llvm-project?rev=257849&view=rev
Log:
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

Modified:
    llvm/trunk/lib/ExecutionEngine/ExecutionEngineBindings.cpp

Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngineBindings.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngineBindings.cpp?rev=257849&r1=257848&r2=257849&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/ExecutionEngineBindings.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/ExecutionEngineBindings.cpp Thu Jan 14 18:23:34 2016
@@ -215,10 +215,12 @@ void LLVMDisposeExecutionEngine(LLVMExec
 }
 
 void LLVMRunStaticConstructors(LLVMExecutionEngineRef EE) {
+  unwrap(EE)->finalizeObject();
   unwrap(EE)->runStaticConstructorsDestructors(false);
 }
 
 void LLVMRunStaticDestructors(LLVMExecutionEngineRef EE) {
+  unwrap(EE)->finalizeObject();
   unwrap(EE)->runStaticConstructorsDestructors(true);
 }
 




More information about the llvm-commits mailing list