Skip to content

flow: object inside arrays #436

Description

@thradams

I believe the following code is not producing the expected result or diagnostics.

#pragma safety enable

void free(void* _Owner _Opt p);
struct X
{
    int size;
    int * _Owner *_Owner data;
};

void f(struct X* _Owner p)
{
    for (int i = 0; i < p->size; i++)
    {
        free(p->data[i]);
    }
    free(p->data);
    free(p);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions