summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorBrian Potchik <brian@vector35.com>2021-04-19 15:39:33 -0400
committerBrian Potchik <brian@vector35.com>2021-04-19 15:39:33 -0400
commit224e24b283b8be99415431856e6b63dea7305996 (patch)
tree96440f2c02cc012ad625bcded8b0c64c2759b785 /python
parent0d52013908d977a12c35e6a03226a90107321c63 (diff)
Fix Mach-O duplicate symbol handling for external relocations.
Diffstat (limited to 'python')
-rw-r--r--python/binaryview.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/python/binaryview.py b/python/binaryview.py
index 1fde4bcd..2af37321 100644
--- a/python/binaryview.py
+++ b/python/binaryview.py
@@ -3956,7 +3956,10 @@ class BinaryView(object):
elif sym_type is not None:
raise AttributeError("Provided sym_type is not of type `binaryninja.Type`")
- core.BNDefineAutoSymbolAndVariableOrFunction(self.handle, plat.handle, sym.handle, sym_type)
+ sym = core.BNDefineAutoSymbolAndVariableOrFunction(self.handle, plat.handle, sym.handle, sym_type)
+ if sym is None:
+ return None
+ return types.Symbol(None, None, None, handle = sym)
def undefine_auto_symbol(self, sym):
"""