Force pc argument to add_hook to be an int or None (#30)
* force pc to be an int or None * follow pep8 more closely * change debug message to an error * use format and isinstance
This commit is contained in:
parent
bbc36a2b2e
commit
98567efeaa
@ -310,7 +310,10 @@ class Manticore(object):
|
||||
Add a callback to be invoked on executing a program counter. Pass 'None'
|
||||
for pc to invoke callback on every instruction.
|
||||
'''
|
||||
self._hooks.setdefault(pc, set()).add(callback)
|
||||
if not (isinstance(pc, (int, long)) or pc is None):
|
||||
raise TypeError("pc must be either an int or None, not {}".format(pc.__class__.__name__))
|
||||
else:
|
||||
self._hooks.setdefault(pc, set()).add(callback)
|
||||
|
||||
def _get_symbol_address(self, symbol):
|
||||
'''
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user