Skip to content

Commit

Permalink
Multiply for alloca & malloca instructions may need to coerce index e…
Browse files Browse the repository at this point in the history
…xpression

to target pointer width.


git-svn-id: http://llvm.org/svn/llvm-project/klee/trunk@77428 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
ddunbar committed Jul 29, 2009
1 parent 14987e0 commit 3ce8b56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Core/Executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1777,9 +1777,9 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) {
kmodule->targetData->getTypeStoreSize(ai->getAllocatedType());
ref<Expr> size = Expr::createPointer(elementSize);
if (ai->isArrayAllocation()) {
// XXX coerce?
ref<Expr> count = eval(ki, 0, state).value;
size = MulExpr::create(count, size);
count = Expr::createCoerceToPointerType(count);
size = MulExpr::create(size, count);
}
bool isLocal = i->getOpcode()==Instruction::Alloca;
executeAlloc(state, size, isLocal, ki);
Expand Down

0 comments on commit 3ce8b56

Please sign in to comment.