From 8871dd7e0f8ef2d5582092416a86dc7f2f991c9c Mon Sep 17 00:00:00 2001 From: Josselin Date: Sat, 22 Aug 2020 15:06:32 +0200 Subject: [PATCH] IR: Add support for function pointer in RETURN operator (fix #590) --- slither/slithir/operations/return_operation.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/slither/slithir/operations/return_operation.py b/slither/slithir/operations/return_operation.py index c93128558..2e5ae3b6a 100644 --- a/slither/slithir/operations/return_operation.py +++ b/slither/slithir/operations/return_operation.py @@ -1,3 +1,4 @@ +from slither.core.declarations import Function from slither.slithir.operations.operation import Operation from slither.slithir.variables.tuple import TupleVariable @@ -15,7 +16,7 @@ class Return(Operation): # ex: return call() # where call() dont return if not isinstance(values, list): - assert is_valid_rvalue(values) or isinstance(values, TupleVariable) or values is None + assert is_valid_rvalue(values) or isinstance(values, (TupleVariable, Function)) or values is None if values is None: values = [] else: @@ -34,7 +35,7 @@ class Return(Operation): if isinstance(value, list): assert all(self._valid_value(v) for v in value) else: - assert is_valid_rvalue(value) or isinstance(value, TupleVariable) + assert is_valid_rvalue(value) or isinstance(value, (TupleVariable, Function)) return True @property