diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-01-16 19:14:49 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-01-16 19:14:49 +0000 |
commit | 4d544a2c807756af6bffc71f1967f22e8045d02e (patch) | |
tree | d3edf071458fab1e7a48307461622f8b83ffddae /lib/ExecutionEngine/JIT/JIT.cpp | |
parent | 75a46eb80005eeacf274c65e07a9fd295d55c6a2 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62336 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT/JIT.cpp')
-rw-r--r-- | lib/ExecutionEngine/JIT/JIT.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp index dc502c1e8b..fd69e69c44 100644 --- a/lib/ExecutionEngine/JIT/JIT.cpp +++ b/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(); } |