Skip to content

Optimisation: Remove final verify from branches (if they are the final statement of the function) #188

Open
@rkalis

Description

@rkalis

Currently, if the final "require" statement in a function happens within a branch, we do not remove it, instead we leave it as OP_VERIFY OP_1 to ensure that the "implicit verify" at the end of the execution succeeds. It would save 2 bytes per case if we can remove that. We need to make sure to do it in a correct and safe way though, which can be hard considering edge cases.

If/when we implement this, we also need to make sure that this does not break the "require message" debug functionality, but this should be covered by current tests.

This is not a very high priority.

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingbreaking changecashc-compilerRelates to the cashc compilerenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions