diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2011-05-18 21:48:31 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2011-05-18 21:48:31 +0000 |
commit | 4ea784dd4deaed11dffec28e7dab0f1eb3c4afc0 (patch) | |
tree | afb50158ecf6d1ecb347d7e5b1e9043c30ba51ee /lib/Expr | |
parent | 8fcc75009e69dbf0acaef87b011891a6a86dfa12 (diff) | |
download | klee-4ea784dd4deaed11dffec28e7dab0f1eb3c4afc0.tar.gz |
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
Diffstat (limited to 'lib/Expr')
-rw-r--r-- | lib/Expr/Expr.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
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<Expr> 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)); |