Open smoelius opened 4 years ago
The panic occurs here: https://github.com/trailofbits/x-audit-blockstack-core/blob/e2d3d5bae539d242851620e28129af6c4a9de642/src/vm/types/signatures.rs#L274 The panic can be witnessed by changing the following test: https://github.com/trailofbits/x-audit-blockstack-core/blob/e2d3d5bae539d242851620e28129af6c4a9de642/src/vm/analysis/type_checker/tests/mod.rs#L584 to:
"(append (list) 4)",
In that case, the type
ListType(ListTypeData { max_len: 0, entry_type: NoType })
is inferred for the append's (list) argument.
append
(list)
Then, at this line in check_special_append, NoType is asked whether it admits IntType: https://github.com/trailofbits/x-audit-blockstack-core/blob/e2d3d5bae539d242851620e28129af6c4a9de642/src/vm/analysis/type_checker/natives/iterables.rs#L160 Hence, the panic.
check_special_append
NoType
IntType
The panic occurs here: https://github.com/trailofbits/x-audit-blockstack-core/blob/e2d3d5bae539d242851620e28129af6c4a9de642/src/vm/types/signatures.rs#L274 The panic can be witnessed by changing the following test: https://github.com/trailofbits/x-audit-blockstack-core/blob/e2d3d5bae539d242851620e28129af6c4a9de642/src/vm/analysis/type_checker/tests/mod.rs#L584 to:
In that case, the type
is inferred for the
append
's(list)
argument.Then, at this line in
check_special_append
,NoType
is asked whether it admitsIntType
: https://github.com/trailofbits/x-audit-blockstack-core/blob/e2d3d5bae539d242851620e28129af6c4a9de642/src/vm/analysis/type_checker/natives/iterables.rs#L160 Hence, the panic.