Only really fork when there's multiple solutions (#569)

This commit is contained in:
Mark Mossberg
2017-11-17 12:40:30 -05:00
committed by GitHub
parent 0e4e9a49e2
commit 35d8fce9df

View File

@@ -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