diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Core/Executor.h | 2 | ||||
-rw-r--r-- | lib/Module/IntrinsicCleaner.cpp | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/lib/Core/Executor.h b/lib/Core/Executor.h index a9d6b791..b7318a2c 100644 --- a/lib/Core/Executor.h +++ b/lib/Core/Executor.h @@ -287,7 +287,7 @@ private: /// Add the given (boolean) condition as a constraint on state. This /// function is a wrapper around the state's addConstraint function - /// which also manages manages propogation of implied values, + /// which also manages propagation of implied values, /// validity checks, and seed patching. void addConstraint(ExecutionState &state, ref<Expr> condition); diff --git a/lib/Module/IntrinsicCleaner.cpp b/lib/Module/IntrinsicCleaner.cpp index b897fcc7..2f18c17e 100644 --- a/lib/Module/IntrinsicCleaner.cpp +++ b/lib/Module/IntrinsicCleaner.cpp @@ -107,7 +107,8 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b) { break; } - case Intrinsic::uadd_with_overflow: { + case Intrinsic::uadd_with_overflow: + case Intrinsic::umul_with_overflow: { IRBuilder<> builder(ii->getParent(), ii); #if LLVM_VERSION_CODE < LLVM_VERSION(2, 8) @@ -118,7 +119,12 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b) { Value *op2 = ii->getArgOperand(1); #endif - Value *result = builder.CreateAdd(op1, op2); + Value *result = 0; + if (ii->getIntrinsicID() == Intrinsic::uadd_with_overflow) + result = builder.CreateAdd(op1, op2); + else + result = builder.CreateMul(op1, op2); + Value *overflow = builder.CreateICmpULT(result, op1); Value *resultStruct = |