Skip to content

Commit 54b77a8

Browse files
author
bjjwwang
committed
fix ass2
1 parent 06dc52a commit 54b77a8

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Assignment-2/Assignment-2.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,19 +141,19 @@ bool SSE::handleNonBranch(const IntraCFGEdge* edge) {
141141
addToSolver(res == op0 % op1);
142142
break;
143143
case BinaryOperator::Xor:
144-
addToSolver(int2bv(32, res) == (int2bv(32, op0) ^ int2bv(32, op1)));
144+
addToSolver(res == bv2int(int2bv(32, op0) ^ int2bv(32, op1), 1));
145145
break;
146146
case BinaryOperator::And:
147-
addToSolver(int2bv(32, res) == (int2bv(32, op0) & int2bv(32, op1)));
147+
addToSolver(res == bv2int(int2bv(32, op0) & int2bv(32, op1), 1));
148148
break;
149149
case BinaryOperator::Or:
150-
addToSolver(int2bv(32, res) == (int2bv(32, op0) | int2bv(32, op1)));
150+
addToSolver(res == bv2int(int2bv(32, op0) | int2bv(32, op1), 1));
151151
break;
152152
case BinaryOperator::AShr:
153-
addToSolver(int2bv(32, res) == ashr(int2bv(32, op0), int2bv(32, op1)));
153+
addToSolver(res == bv2int(ashr(int2bv(32, op0), int2bv(32, op1)), 1));
154154
break;
155155
case BinaryOperator::Shl:
156-
addToSolver(int2bv(32, res) == shl(int2bv(32, op0), int2bv(32, op1)));
156+
addToSolver(res == bv2int(shl(int2bv(32, op0), int2bv(32, op1)), 1));
157157
break;
158158
default:
159159
assert(false && "implement this part");

Assignment-2/Assignment-2.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ namespace SVF {
7575
/// reset z3 solver
7676
virtual void resetSolver() {
7777
getSolver().reset();
78+
callingCtx.clear();
7879
}
7980

8081
/// TODO: Implementing the collection the ICFG paths

0 commit comments

Comments
 (0)