crytic-compile icon indicating copy to clipboard operation
crytic-compile copied to clipboard

Change get_global_offset_from_line to also take an optional character position

Open Xenomega opened this issue 4 years ago • 1 comments

Currently, crytic-compile has a function to take a source file offset and convert it into line and character position numbers. To reverse this operation, get_global_offset_from_line could be used, but it only takes a line number, not a character position number.

This PR adds an optional character position parameter which can be used to specify a position on a line number which we want to obtain a source offset for.

It also renames get_global_offset_from_line to get_global_offset_from_line_and_character and get_line_from_offset into get_line_and_character_from_offset for clarity.

Xenomega avatar Jul 07 '21 15:07 Xenomega

This PR has been on hold because the breaking change might impact other projects. Slither has an open PR https://github.com/crytic/slither/pull/889, but the related code has changed so it needs to be updated

Before merging this, we should check in the crytic and trailofbits orgs if other projects are affected (manticore or evm-cfg-builder maybe?)

montyly avatar Jan 06 '23 20:01 montyly