Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing struct in struct produces internal error #20

Open
DrSkunk opened this issue Apr 20, 2016 · 1 comment
Open

Accessing struct in struct produces internal error #20

DrSkunk opened this issue Apr 20, 2016 · 1 comment

Comments

@DrSkunk
Copy link

DrSkunk commented Apr 20, 2016

The following code give the error: "Verification failed due to an internal error. See the console window for details."

struct xARP_HEADER
{
    int usHardwareType;
};

struct xARP_PACKET
{
    struct xARP_HEADER xARPHeader;
};

void main( struct xARP_PACKET * pxARPFrame )
//@ requires xARP_PACKET_xARPHeader(pxARPFrame, _);
//@ ensures true;
{}

Entry in console:

VeriFast internal error:
File "verifast1.ml", line 301, characters 23-29: Assertion failed

When struct xARP_HEADER xARPHeader; is changed to struct xARP_HEADER * xARPHeader; the verification goes through.

Tested with Verifast 15.11

@btj
Copy link
Member

btj commented Apr 20, 2016

You should mention each leaf field separately. This works:

struct xARP_HEADER
{
    int usHardwareType;
};

struct xARP_PACKET
{
    struct xARP_HEADER xARPHeader;
};

void main( struct xARP_PACKET * pxARPFrame )
//@ requires pxARPFrame->xARPHeader.usHardwareType |-> _;
//@ ensures true;
{}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants