Fix evm state handling regression (#741)

* Revert breaking change

* Add assertion to verify states being queued
This commit is contained in:
Mark Mossberg 2018-02-20 04:57:07 -08:00 committed by feliam
parent 105a7d3aee
commit 9f0d25c5d9
3 changed files with 5 additions and 3 deletions

View File

@ -253,7 +253,7 @@ class Executor(Eventful):
'''
#save the state to secondary storage
state_id = self._workspace.save_state(state)
self._put(state_id)
self.put(state_id)
self._publish('did_enqueue_state', state_id, state)
return state_id
@ -304,7 +304,7 @@ class Executor(Eventful):
###############################################
# Priority queue
@sync
def _put(self, state_id):
def put(self, state_id):
''' Enqueue it for processing '''
self._states.append(state_id)
self._lock.notify_all()

View File

@ -15,6 +15,7 @@ from multiprocessing.managers import SyncManager
from .smtlib import solver
from .smtlib.solver import SolverException
from .state import State
logger = logging.getLogger(__name__)
@ -389,6 +390,7 @@ class Workspace(object):
:return: New state id
:rtype: int
"""
assert isinstance(state, State)
id_ = self._get_id()
self._store.save_state(state, '{}{:08x}{}'.format(self._prefix, id_, self._suffix))
return id_

View File

@ -925,7 +925,7 @@ class ManticoreEVM(Manticore):
assert len(self._executor.list()) == 0
for state_id in context['_saved_states']:
self._executor.enqueue(state_id)
self._executor.put(state_id)
context['_saved_states'] = []
#A callback will use _pending_transaction and issue the transaction