From 5f936ef1acfbe298591e22948ade326db528a5cc Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Fri, 16 Jan 2009 19:14:49 +0000 Subject: Change isGVCompilationDisabled() semantics again. It should abort on any GV that's not constant whether it's "internal" or not. In a server / client environment, GV is returned in the same block of memory as code. However, the memory might not be writable. llvm-svn: 62336 --- llvm/lib/ExecutionEngine/JIT/JIT.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'llvm/lib/ExecutionEngine') diff --git a/llvm/lib/ExecutionEngine/JIT/JIT.cpp b/llvm/lib/ExecutionEngine/JIT/JIT.cpp index dc502c1e8be..fd69e69c44d 100644 --- a/llvm/lib/ExecutionEngine/JIT/JIT.cpp +++ b/llvm/lib/ExecutionEngine/JIT/JIT.cpp @@ -554,7 +554,10 @@ void *JIT::getOrEmitGlobalVariable(const GlobalVariable *GV) { addGlobalMapping(GV, Ptr); } } else { - if (isGVCompilationDisabled() && !GV->hasLocalLinkage()) { + // GlobalVariable's which are not "constant" will cause trouble in a server + // situation. It's returned in the same block of memory as code which may + // not be writable. + if (isGVCompilationDisabled() && !GV->isConstant()) { cerr << "Compilation of non-internal GlobalValue is disabled!\n"; abort(); } -- cgit v1.2.3