-
-
Notifications
You must be signed in to change notification settings - Fork 887
panic on some cyclic function call checks #4194
Copy link
Copy link
Closed
Description
Version Information
- vyper Version (output of
vyper --version):0.4.0b6+commit.7485ceab
Issue description and/or POC
The _compute_reachable_set will recursively call itself with the modified path variable, checking only the root = path[0] variable for every fn_t.called_functions iteration.
if g == root:
message = " -> ".join([f.name for f in path])
raise CallViolation(f"Contract contains cyclic function call: {message}")In the following example, the path list will be [foo, bar, bar, bar, ...], where root is foo, falling into infinite recursion.
@external
def foo():
self.bar()
@internal
def bar():
self.bar()The error message RecursionError: maximum recursion depth exceeded while calling a Python object
How can it be fixed?
Reactions are currently unavailable