-
-
Notifications
You must be signed in to change notification settings - Fork 887
Mistyped Loop Iterable #3988
Copy link
Copy link
Open
Labels
bug - type 0compiler halts or panics instead of generating codecompiler halts or panics instead of generating code
Description
Version Information
- vyper Version (output of
vyper --version): commit 4b4e188
Issue description
If a loop is defined over some non-literal static or dynamic array, the
type obtained from the annotation of the iterator is not used to
type-check the iterable. If the iterable's value type does not match the
annotation, the type-checker will miss it and the compiler will later
panic during code generation due to some assertion.
POC
For example, the following code crashes the compiler with
vyper.exceptions.CodegenPanic: unhandled exception , parse_For.
@external
@pure
def foo() :
s:int256[3] = [1,-1,1]
for i:uint256 in s:
print(i)credits: @trocher
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug - type 0compiler halts or panics instead of generating codecompiler halts or panics instead of generating code