diff options
Diffstat (limited to 'lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r-- | lib/ExecutionEngine/ExecutionEngine.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp index 9b119c73e3..e37d56f2cc 100644 --- a/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/lib/ExecutionEngine/ExecutionEngine.cpp @@ -54,13 +54,15 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) { if (Op->getType()->getPrimitiveID() == C->getType()->getPrimitiveID()) return getConstantValue(Op); - // Handle cast of long to pointer or pointer to long... - if ((isa<PointerType>(Op->getType()) && (C->getType() == Type::LongTy || - C->getType() == Type::ULongTy))|| - (isa<PointerType>(C->getType()) && (Op->getType() == Type::LongTy || - Op->getType() == Type::ULongTy))){ + // Handle a cast of pointer to any integral type... + if (isa<PointerType>(Op->getType()) && + (C->getType() == Type::LongTy || C->getType() == Type::ULongTy)) + return getConstantValue(Op); + + // Handle cast of long to pointer... + if (isa<PointerType>(C->getType()) && (Op->getType() == Type::LongTy || + Op->getType() == Type::ULongTy)) return getConstantValue(Op); - } break; } |