Skip to content

ownership check failing! #407

@thradams

Description

@thradams

This code reproduces the problem

#pragma safety enable

struct Y {
    struct X* _Owner _Opt y;
};

void y_destroy([[dtor]] struct X* p)
{
    //missing warning about p->s not released!    
}

struct X {
    char* _Owner _Opt s;
};

flow analysis is running after y_destroy.
The problem is that the struct still incomplete.

Solution:
Run flow analysis at the end.
The consequence is that flow analysis warnings and parser warnings for the same function will be printed separately..
Unless parser warning were accumulated and only printed at the end.

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