summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJosh Watson <josh@trailofbits.com>2019-05-10 14:22:43 -0700
committerKyleMiles <krm504@nyu.edu>2019-05-30 19:14:12 -0400
commit0822865ad450d19f5b2fff9e48edba322272327d (patch)
tree41eda86df992a7dedf5ff9cb140cb2589cf64135 /python
parent4f13add7774cb0d5b97f1eccbfaaab07a647e5be (diff)
Fix Architecture.assemble so that it works with ArchitectureHooks
Diffstat (limited to 'python')
-rw-r--r--python/architecture.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/python/architecture.py b/python/architecture.py
index 2d81beb0..c72f8048 100644
--- a/python/architecture.py
+++ b/python/architecture.py
@@ -1057,8 +1057,7 @@ class Architecture(with_metaclass(_ArchitectureMetaClass, object)):
def _assemble(self, ctxt, code, addr, result, errors):
try:
- data, error_str = self.assemble(code, addr)
- errors[0] = core.BNAllocString(str(error_str))
+ data = self.assemble(code, addr)
if data is None:
return False
buf = ctypes.create_string_buffer(len(data))
@@ -1272,7 +1271,7 @@ class Architecture(with_metaclass(_ArchitectureMetaClass, object)):
:return: the bytes for the assembled instructions or error string
:rtype: (a tuple of instructions and empty string) or (or None and error string)
"""
- return None, "Architecture does not implement an assembler.\n"
+ raise NotImplementedError("Architecture does not implement an assembler.\n")
@abc.abstractmethod
def perform_is_never_branch_patch_available(self, data, addr):