diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp index a3c3f47036f..0b5d19eb6f9 100644 --- a/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/lib/ExecutionEngine/ExecutionEngine.cpp @@ -31,7 +31,7 @@ void *ExecutionEngine::getPointerToGlobal(const GlobalValue *GV) { GenericValue ExecutionEngine::getConstantValue(const Constant *C) { GenericValue Result; - if (ConstantExpr *CE = (ConstantExpr*)dyn_cast(C)) + if (ConstantExpr *CE = const_cast(dyn_cast(C))) switch (CE->getOpcode()) { case Instruction::GetElementPtr: { Result = getConstantValue(cast(CE->getOperand(0)));