summaryrefslogtreecommitdiff
path: root/python/callingconvention.py
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2021-10-04 16:57:33 -0400
committerPeter LaFosse <peter@vector35.com>2021-10-04 16:57:33 -0400
commit072021568045f1bceb39b3dc217235c5eebc37a9 (patch)
tree24e9841c3f39c74a344e21ecf8b62816e8398573 /python/callingconvention.py
parentc7e2482967cf0cdf25ed114fab6d4f7948caea8f (diff)
Fix error condition on _get_int_return_reg
Diffstat (limited to 'python/callingconvention.py')
-rw-r--r--python/callingconvention.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/python/callingconvention.py b/python/callingconvention.py
index 1b068536..6ab587a0 100644
--- a/python/callingconvention.py
+++ b/python/callingconvention.py
@@ -293,10 +293,11 @@ class CallingConvention:
return False
def _get_int_return_reg(self, ctxt):
+ if self.__class__.int_return_reg is None:
+ return False
+ assert isinstance(self.__class__.int_return_reg, str), "int_return_reg return reg must be a string"
+
try:
- if not isinstance(self.__class__.int_return_reg, str):
- log_error(traceback.format_exc())
- return False
return self.arch.regs[self.__class__.int_return_reg].index
except:
log_error(traceback.format_exc())