crytic / tealer

Static Analyzer for Teal
GNU Affero General Public License v3.0
62 stars 14 forks source link

Update txn field analysis to use new CFG #168

Closed S3v3ru5 closed 1 year ago

S3v3ru5 commented 1 year ago

The analysis is still performed on the global CFG where callsub are considered as connected to the subroutine entry blocks, etc. However, the objects used are part of the new CFG.

The result of the analysis is stored in the old CFG block objects to reuse the old tests.

Added new members to BasicBlock class. The new member check that values are properly initialized instead of returning Optional[...] type value. If a member is intended to be initialized at the time of parsing, then the properties of the corresponding members check the member is properly initialized. Otherwise, raise an TealerException.

tests/parsing/teal8-instructions.teal is updated. previous code is invalid code, the execution B3 block would fall through to B4 block. B4 is a subroutine and B3 does not call the subroutine. When Retsub will be executed in B4, the execution would fail at runtime.

S3v3ru5 commented 1 year ago

Builds on #167 167