summaryrefslogtreecommitdiff
path: root/python/function.py
diff options
context:
space:
mode:
authorRyan Snyder <ryan@vector35.com>2018-03-20 09:53:59 -0400
committerPeter LaFosse <peter@vector35.com>2018-03-23 17:10:07 -0400
commitcacaec3766abddd15233aa1be7df2efc804fe996 (patch)
tree2fba0c2a192ba8211fa40c48f95e2ba1c113ecee /python/function.py
parent19b66619718e8b114db2fefc498018af44010ac6 (diff)
Cache all created CoreArchitecture objects
Diffstat (limited to 'python/function.py')
-rw-r--r--python/function.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/python/function.py b/python/function.py
index 0d796d98..8c4b7765 100644
--- a/python/function.py
+++ b/python/function.py
@@ -420,7 +420,7 @@ class Function(object):
arch = core.BNGetFunctionArchitecture(self.handle)
if arch is None:
return None
- self._arch = architecture.CoreArchitecture(arch)
+ self._arch = architecture.CoreArchitecture._from_cache(arch)
return self._arch
@property
@@ -558,7 +558,7 @@ class Function(object):
branches = core.BNGetIndirectBranches(self.handle, count)
result = []
for i in xrange(0, count.value):
- result.append(IndirectBranchInfo(architecture.CoreArchitecture(branches[i].sourceArch), branches[i].sourceAddr, architecture.Architecture(branches[i].destArch), branches[i].destAddr, branches[i].autoDefined))
+ result.append(IndirectBranchInfo(architecture.CoreArchitecture._from_cache(branches[i].sourceArch), branches[i].sourceAddr, architecture.Architecture(branches[i].destArch), branches[i].destAddr, branches[i].autoDefined))
core.BNFreeIndirectBranchList(branches)
return result
@@ -1142,7 +1142,7 @@ class Function(object):
branches = core.BNGetIndirectBranchesAt(self.handle, arch.handle, addr, count)
result = []
for i in xrange(0, count.value):
- result.append(IndirectBranchInfo(architecture.CoreArchitecture(branches[i].sourceArch), branches[i].sourceAddr, architecture.Architecture(branches[i].destArch), branches[i].destAddr, branches[i].autoDefined))
+ result.append(IndirectBranchInfo(architecture.CoreArchitecture._from_cache(branches[i].sourceArch), branches[i].sourceAddr, architecture.Architecture(branches[i].destArch), branches[i].destAddr, branches[i].autoDefined))
core.BNFreeIndirectBranchList(branches)
return result
@@ -1660,7 +1660,7 @@ class FunctionGraphBlock(object):
arch = core.BNGetFunctionGraphBlockArchitecture(self.handle)
if arch is None:
return None
- return architecture.CoreArchitecture(arch)
+ return architecture.CoreArchitecture._from_cache(arch)
@property
def start(self):