diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-06-04 08:59:53 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-06-04 08:59:53 +0000 |
commit | 92004d6524c7633aa1e014e5b727a39475652dda (patch) | |
tree | e68a45e3aa57b34a33f5f1dfbb496acb8bcebc9a /lib/Core/SpecialFunctionHandler.cpp | |
parent | 21fb3bd80309b30ed2223e793003ac4744776dfb (diff) | |
download | klee-92004d6524c7633aa1e014e5b727a39475652dda.tar.gz |
Sink getConstantValue into ConstantExpr.
- Propogate ConstantExpr to various places, or cast as appropriate. git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@72862 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Core/SpecialFunctionHandler.cpp')
-rw-r--r-- | lib/Core/SpecialFunctionHandler.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Core/SpecialFunctionHandler.cpp b/lib/Core/SpecialFunctionHandler.cpp index ea2594eb..2ee73457 100644 --- a/lib/Core/SpecialFunctionHandler.cpp +++ b/lib/Core/SpecialFunctionHandler.cpp @@ -419,7 +419,7 @@ void SpecialFunctionHandler::handleUnderConstrained(ExecutionState &state, assert(isa<ConstantExpr>(arguments[0]) && "symbolic argument given to klee_under_constrained!"); - unsigned v = arguments[0]->getConstantValue(); + unsigned v = cast<ConstantExpr>(arguments[0])->getConstantValue(); llvm::cerr << "argument = " << v << " under=" << state.underConstrained << "\n"; if(v) { assert(state.underConstrained == false && @@ -599,14 +599,14 @@ void SpecialFunctionHandler::handleCheckMemoryAccess(ExecutionState &state, } else { ObjectPair op; - if (!state.addressSpace.resolveOne(address->getConstantValue(), op)) { + if (!state.addressSpace.resolveOne(cast<ConstantExpr>(address)->getConstantValue(), op)) { executor.terminateStateOnError(state, "check_memory_access: memory error", "ptr.err", executor.getAddressInfo(state, address)); } else { ref<Expr> chk = op.first->getBoundsCheckPointer(address, - size->getConstantValue()); + cast<ConstantExpr>(size)->getConstantValue()); if (!cast<ConstantExpr>(chk)->getConstantValue()) { executor.terminateStateOnError(state, "check_memory_access: memory error", @@ -636,8 +636,8 @@ void SpecialFunctionHandler::handleDefineFixedObject(ExecutionState &state, assert(isa<ConstantExpr>(arguments[1]) && "expect constant size argument to klee_define_fixed_object"); - uint64_t address = arguments[0]->getConstantValue(); - uint64_t size = arguments[1]->getConstantValue(); + uint64_t address = cast<ConstantExpr>(arguments[0])->getConstantValue(); + uint64_t size = cast<ConstantExpr>(arguments[1])->getConstantValue(); MemoryObject *mo = executor.memory->allocateFixed(address, size, state.prevPC->inst); executor.bindObjectInState(state, mo, false); mo->isUserSpecified = true; // XXX hack; |