[PATCH] D16188: LLVMRunStaticConstructors can be called before object is finalized, #24028
David Herberth via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 14 08:02:57 PST 2016
Dav1d created this revision.
Dav1d added reviewers: deadalnix, echristo.
Dav1d added a subscriber: llvm-commits.
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).
http://reviews.llvm.org/D16188
Files:
lib/ExecutionEngine/ExecutionEngineBindings.cpp
Index: lib/ExecutionEngine/ExecutionEngineBindings.cpp
===================================================================
--- lib/ExecutionEngine/ExecutionEngineBindings.cpp
+++ lib/ExecutionEngine/ExecutionEngineBindings.cpp
@@ -215,10 +215,12 @@
}
void LLVMRunStaticConstructors(LLVMExecutionEngineRef EE) {
+ unwrap(EE)->finalizeObject();
unwrap(EE)->runStaticConstructorsDestructors(false);
}
void LLVMRunStaticDestructors(LLVMExecutionEngineRef EE) {
+ unwrap(EE)->finalizeObject();
unwrap(EE)->runStaticConstructorsDestructors(true);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16188.44882.patch
Type: text/x-patch
Size: 562 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160114/6455daad/attachment.bin>
More information about the llvm-commits
mailing list