Open smoelius opened 4 years ago
Ha! I found out about this panic while working on the implementation of the traits, and fixed it. I just added and pushed a test case here: https://github.com/blockstack/blockstack-core/pull/1246/commits/0cc0da6f627fd752bf6b7edc4943237b4437b324
The panic occurs at the
unwrap
in the following lines: https://github.com/trailofbits/x-audit-blockstack-core/blob/e2d3d5bae539d242851620e28129af6c4a9de642/src/vm/analysis/definition_sorter/mod.rs#L60-L63 The panic can be witnessed by adding the lineat the end of the following test contract: https://github.com/trailofbits/x-audit-blockstack-core/blob/e2d3d5bae539d242851620e28129af6c4a9de642/src/vm/analysis/definition_sorter/tests.rs#L58-L62 The problem appears to be:
get_cycling_dependencies
identifies the line(a 0)
as contributing to a cycle, but the following line expects all such contributors to parse as definitions: https://github.com/trailofbits/x-audit-blockstack-core/blob/e2d3d5bae539d242851620e28129af6c4a9de642/src/vm/analysis/definition_sorter/mod.rs#L203 One way to resolve this issue is to remove theunwrap
and change the above map to afilter_map
.