From 8b8d4c41d2dd60ad4db5e046845145ac3818a9d5 Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Wed, 26 Oct 2016 12:41:53 -0400 Subject: [PATCH] [llvm] Use the global llvm context instead of creating a new one for each aot module, since the latter seems to cause random memory corruption/crashes. --- mono/mini/mini-llvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mono/mini/mini-llvm.c b/mono/mini/mini-llvm.c index a21c10fd782..b83c823acfb 100644 --- a/mono/mini/mini-llvm.c +++ b/mono/mini/mini-llvm.c @@ -8366,7 +8366,7 @@ mono_llvm_create_aot_module (MonoAssembly *assembly, const char *global_prefix, module->llvm_only = llvm_only; /* The first few entries are reserved */ module->max_got_offset = 16; - module->context = LLVMContextCreate (); + module->context = LLVMGetGlobalContext (); if (llvm_only) /* clang ignores our debug info because it has an invalid version */ -- 2.11.4.GIT