Merge pull request #601 from crytic/dev-support-return-func-pointer

IR: Add support for function pointer in RETURN operator
pull/605/head
Feist Josselin 4 years ago committed by GitHub
commit 573fa9629b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      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

Loading…
Cancel
Save