You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vyper Version (output of vyper --version): 0.3.8+commit.ae7d6d28
OS: OSX
Python Version (output of python --version): 3.8.0
What's your issue about?
The compiler checks that there is no exit statements (Return, Selfdestruct, Raise) with succeeding code (that would not execute) including other exit statements.
As For loops are not checked for this matter by the compiler it is possible to compile exit statements with succeeding code.
For example, in the following, foo will fail to compile due to a StructureException (Exit statement with succeeding code) while bar would compile.
@externaldef foo():
if(True):
return
a:uint256=2
@externaldef bar():
for i in range(12):
return
a:uint256=2
How can it be fixed?
Adding a case to handle For statements in check_single_exit should be enough to fix the issue.
The text was updated successfully, but these errors were encountered:
Version Information
vyper --version
): 0.3.8+commit.ae7d6d28python --version
): 3.8.0What's your issue about?
The compiler checks that there is no exit statements (
Return
,Selfdestruct
,Raise
) with succeeding code (that would not execute) including other exit statements.As
For
loops are not checked for this matter by the compiler it is possible to compile exit statements with succeeding code.For example, in the following,
foo
will fail to compile due to aStructureException
(Exit statement with succeeding code
) whilebar
would compile.How can it be fixed?
Adding a case to handle
For
statements incheck_single_exit
should be enough to fix the issue.The text was updated successfully, but these errors were encountered: