1
0
mirror of https://github.com/RPCS3/llvm.git synced 2025-04-07 15:52:21 +00:00

LLVMRunStaticConstructors can be called before object is finalized,

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257849 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Amaury Sechet 2016-01-15 00:23:34 +00:00
parent 9039b1ff4e
commit a0bd1626ca

@ -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);
}