Change isGVCompilationDisabled() semantics again. It should abort on any GV that...
authorEvan Cheng <evan.cheng@apple.com>
Fri, 16 Jan 2009 19:14:49 +0000 (19:14 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 16 Jan 2009 19:14:49 +0000 (19:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62336 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/JIT/JIT.cpp

index dc502c1e8be1381c1557f61c2c09551056332a46..fd69e69c44d5d711e8e8e6fe2db47c152b5ae90a 100644 (file)
@@ -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();
     }