diff --git a/lib/ExecutionEngine/JIT/JITEmitter.cpp b/lib/ExecutionEngine/JIT/JITEmitter.cpp index f14d6f6ef48..cbfaa09e36d 100644 --- a/lib/ExecutionEngine/JIT/JITEmitter.cpp +++ b/lib/ExecutionEngine/JIT/JITEmitter.cpp @@ -551,6 +551,8 @@ void *JITEmitter::getPointerToGlobal(GlobalValue *V, void *Reference, /// global immediately instead of queuing it for codegen later! return TheJIT->getOrEmitGlobalVariable(GV); } + if (GlobalAlias *GA = dyn_cast(V)) + return TheJIT->getPointerToGlobal(GA->resolveAliasedGlobal()); // If we have already compiled the function, return a pointer to its body. Function *F = cast(V);