Skip to content

[TASK] Computed JUMPDEST Improvements #87

@iamrecursion

Description

@iamrecursion

Description

The CpuFrilessVerifier contract has some situations where a non-conditional JUMP instruction jumps to different destinations based on the offset (of a JUMPDEST) that gets pushed onto the stack at some point prior to reaching the JUMP instruction.

image

The smlXL control flow generator (an internal tool) shows that these independent paths are able to be discovered statically (as it also does symbolic execution), which implies that the SLA should be able to reach all of these paths during its execution.

However, it currently does reach all of these paths (as evidenced by us never seeing the SLOAD opcodes and not finding a layout). Based on analysis of the full CFG, it looks like these things are certainly reachable from the initial function dispatch table, so we should be able to improve the analyzer to reach these.

It does not appear that the JUMPDEST is ever non-constant as far as the analyzer is concerned, so we are not bailing in that respect. This makes it all the more probable that we should be able to deal with this situation properly.

Spec

  • Work out a strategy—potentially using a mechanism like the one described in [FEAT] Extensible Execution Strategies #48—that allows us to see these JUMPDESTs correctly.
  • Alternatively, work out a strategy that blindly visits all un-visited JUMPDESTs while retaining type coherence.
  • Implement whichever sounds best.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions