Skip to content

support non-init output slots on STMT_call #24

Description

@graydon

Currently Trans.trans_call takes an argument indicating whether it's an
initializing call, but it always behaves as though it's initializing, even if
the argument is false. This is because there's a bit of a subtlety involved in
refcounted values: the same referent may be used as both dst of the call and as
an arg, and we want to avoid having it drop before being pinned as an arg,
because the dst was dropped.

The existing code may have been born in the CoW era and may no longer represent
a real hazard if rearranged to just pin args first then drop dst; will need a
few careful tests to be sure the arrangement actually works.

(Alternatively: worst case, make a static pass that prohibits x = f(x) the same
way f(x,x) is to be prohibited if both slots are alias-mode.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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