diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp index 72d08f5fe16..9b119c73e35 100644 --- a/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/lib/ExecutionEngine/ExecutionEngine.cpp @@ -22,7 +22,7 @@ Statistic<> NumInitBytes("lli", "Number of bytes of global vars initialized"); // value. This may involve code generation if it's a function. // void *ExecutionEngine::getPointerToGlobal(const GlobalValue *GV) { - if (const Function *F = dyn_cast(GV)) + if (Function *F = const_cast(dyn_cast(GV))) return getPointerToFunction(F); assert(GlobalAddress[GV] && "Global hasn't had an address allocated yet?");