Skip to content

Inline expansion loses early-return semantics when branch conditions are non-exhaustive #54

@adust09

Description

@adust09

Summary

### Non exhaustive conditions in inlined functions

What I’ve tried

  • Active flag approach: Introduced a guard variable that gets set to 0 after a return, expecting later statements to be skipped. This failed because the VM forbids overwriting the same memory slot (SSA), so the guard cannot be toggled from 1 to 0.
  • Jump/Label approach: Replaced each inlined return with jump end_label. Although this preserves control flow in theory, we still assign directly into the caller’s result variable on every return path; the SSA invariant breaks when different paths try to write different values,
    and runtime fails with Computation invalid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions