Hi,

I'm submitting a patch that adds support in the KLEE executor for handling
bitcasted aliased calls, which are valid LLVM constructs that might be
encountered from time to time.

Stefan

=================================

diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
index d54fc26..0955ffd 100644
--- a/lib/Core/Executor.cpp
+++ b/lib/Core/Executor.cpp
@@ -1689,7 +1689,13 @@ void Executor::executeInstruction(ExecutionState
&state, KInstruction *ki) {
       llvm::ConstantExpr *ce = dyn_cast<llvm::ConstantExpr>(fp);

       if (ce && ce->getOpcode()==Instruction::BitCast) {
-        f = dyn_cast<Function>(ce->getOperand(0));
+       if (GlobalAlias *target = dyn_cast<GlobalAlias>(ce->getOperand(0)))
{
+ GlobalValue *GV =
const_cast<GlobalValue*>(target->resolveAliasedGlobal(false));
+ f = dyn_cast<Function>(GV);
+ } else {
+ f = dyn_cast<Function>(ce->getOperand(0));
+ }
+
         assert(f && "XXX unrecognized constant expression in call");
         const FunctionType *fType =

 dyn_cast<FunctionType>(cast<PointerType>(f->getType())->getElementType());
_______________________________________________
klee-dev mailing list
[email protected]
http://keeda.Stanford.EDU/mailman/listinfo/klee-dev

Reply via email to