From 8601612227e50352eecba41168252eee1e9c0410 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 29 Jul 2009 04:13:37 +0000 Subject: Multiply for alloca & malloca instructions may need to coerce index expression to target pointer width. git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@77428 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Core/Executor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/Core/Executor.cpp') diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp index a8056b8b..5118fac2 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp @@ -1777,9 +1777,9 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) { kmodule->targetData->getTypeStoreSize(ai->getAllocatedType()); ref size = Expr::createPointer(elementSize); if (ai->isArrayAllocation()) { - // XXX coerce? ref 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); -- cgit 1.4.1