Skip to content

Tensor modifier may map a temporary #287

Closed

Description

@trsxvz

include/MGIS/Function/TFEL/TensorModifier.ixx:32-35, with EvaluatorModifierBase.ixx:50, 58, 66, 76.

Finding. apply maps a TFEL tensor view onto values.data(), where values is bound to the prvalue returned by the wrapped evaluator. When that evaluator returns by value, the view points at a destroyed temporary. The requirement that gates the modifier only asks for a data() member.

Effect. Re-interpreting the output of a unary operation or a transform as a TFEL tensor reads dead stack. Reproduced under the address sanitiser; at higher optimisation levels the values happen to be right.

Fix. Map when the result is a reference or a lightweight view, copy otherwise.

Activity

  1. added a commit that references this issue on Oct 2, 2026
  2. linked a pull request that will close this issueFix Issue #287 #299on Oct 2, 2026
  3. added a commit that references this issue on Oct 2, 2026
  4. changed the title [-]Tensor modifier maps a temporary[/-] [+]Tensor modifier may map a temporary[/+] on Oct 2, 2026
  5. added a commit that references this issue on Oct 2, 2026
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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions