xr0-org / xr0

The Xr0 Verifier for C
https://xr0.dev
Apache License 2.0
173 stars 4 forks source link

Implement pass by pointer #28

Closed claude-betz closed 6 months ago

claude-betz commented 6 months ago

We need to be able to pass in the address of a variable (pointer) as an argument to a function and modify the variable.

void
modify_num(int *i)
{
    *i = 2;
}

int
main()
{
    int num;
    num = 1;
    modify_num(&num);

    /* num = 2 */
}