aboutsummaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/JIT/JIT.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ExecutionEngine/JIT/JIT.cpp')
-rw-r--r--lib/ExecutionEngine/JIT/JIT.cpp5
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();
}