From 35d8fce9df21f3fa645f24174589df84061fe0c1 Mon Sep 17 00:00:00 2001 From: Mark Mossberg Date: Fri, 17 Nov 2017 12:40:30 -0500 Subject: [PATCH] Only really fork when there's multiple solutions (#569) --- manticore/core/executor.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/manticore/core/executor.py b/manticore/core/executor.py index 8ad9565..3c87329 100644 --- a/manticore/core/executor.py +++ b/manticore/core/executor.py @@ -380,6 +380,10 @@ class Executor(Eventful): #Find a set of solutions for expression solutions = state.concretize(expression, policy) + if len(solutions) == 1: + setstate(state, solutions[0]) + return state + logger.info("Forking, about to store. (policy: %s, values: %s)", policy, ', '.join('0x{:x}'.format(sol) for sol in solutions)) @@ -468,8 +472,7 @@ class Executor(Eventful): #setstate() logger.debug("Generic state fork on condition") - self.fork(current_state, e.expression, e.policy, e.setstate) - current_state = None + current_state = self.fork(current_state, e.expression, e.policy, e.setstate) except TerminateState as e: #Notify this worker is done