From 4ea784dd4deaed11dffec28e7dab0f1eb3c4afc0 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 18 May 2011 21:48:31 +0000 Subject: Support for arbitrary sized types in ConstantExpr::fromMemory git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@131583 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Expr/Expr.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/Expr') diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp index e02a7e49..c9754765 100644 --- a/lib/Expr/Expr.cpp +++ b/lib/Expr/Expr.cpp @@ -300,14 +300,13 @@ void Expr::dump() const { ref ConstantExpr::fromMemory(void *address, Width width) { switch (width) { - default: assert(0 && "invalid type"); case Expr::Bool: return ConstantExpr::create(*(( uint8_t*) address), width); case Expr::Int8: return ConstantExpr::create(*(( uint8_t*) address), width); case Expr::Int16: return ConstantExpr::create(*((uint16_t*) address), width); case Expr::Int32: return ConstantExpr::create(*((uint32_t*) address), width); case Expr::Int64: return ConstantExpr::create(*((uint64_t*) address), width); // FIXME: what about machines without x87 support? - case Expr::Fl80: + default: return ConstantExpr::alloc(llvm::APInt(width, (width+llvm::integerPartWidth-1)/llvm::integerPartWidth, (const uint64_t*)address)); -- cgit 1.4.1