Skip to content

When a non-mutating method returns a pointer to a field, sometimes that pointer is corrupted #942

@yorickpeterse

Description

@yorickpeterse

Please describe the bug

This is something I've noticed a few times now: if you have some method fn mut foo { @a.field_containing_extern_value } then all is well, but when you change the method to fn foo { ... } it seems the pointer gets corrupted somehow. To further complicate things this doesn't always seem to be the case.

We'll need a standalone way to reproduce this first, then we need to ensure that the behavior is the same for both fn mut and fn methods (i.e. no broken pointers).

Operating system

Fedora

Inko version

main

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting contributionsIssues that are suitable to be worked on by anybody, not just maintainerscompilerChanges related to the compiler

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions