Skip to content

Add a new method to check whether a pointer points to a valid location #8217

@celinval

Description

@celinval

I would like to be able to instrument my code to check that one or more pointers can be safely dereferenced, i.e., that the pointer points to an allocated object.

From the discussion in #8199, we concluded that this cannot be achieved by using __CPROVER_r_ok, since its behavior isn't well defined for invalid pointers.

Ideally, we would have an API similar to __CPROVER_r_ok that returns false when the pointer argument isn't dereferenceable.

In the meantime, I was wondering what is the proper way of asserting that a pointer is valid.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions