From 13300d89138731c535dd1e6c272fa6c5773714ef Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Wed, 3 Oct 2018 17:20:40 +0530 Subject: [PATCH] Use solver translate --- mythril/laser/ethereum/state.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mythril/laser/ethereum/state.py b/mythril/laser/ethereum/state.py index 84f22f0a..d170aba6 100644 --- a/mythril/laser/ethereum/state.py +++ b/mythril/laser/ethereum/state.py @@ -147,7 +147,7 @@ class Constraints(list): def append(self, constraint): self.__possibility = None super(Constraints, self).append(constraint) - self.solver = copy(self.solver) + self.solver = self.solver.translate(self.solver.ctx) self.solver.add(constraint) def pop(self, index=-1): @@ -162,14 +162,16 @@ class Constraints(list): def __add__(self, constraints): constraints_list = super(Constraints, self).__add__(constraints) - new_solver = copy(self.solver) + new_solver = self.solver.translate(self.solver.ctx) + for constraint in constraints: new_solver.add(constraint) return Constraints(constraint_list=constraints_list, solver=new_solver) def __iadd__(self, constraints): super(Constraints, self).__iadd__(constraints) - self.solver = copy(self.solver) + self.solver = self.solver.translate(self.solver.ctx) + for constraint in constraints: self.solver.add(constraint) return self