kani icon indicating copy to clipboard operation
kani copied to clipboard

Cross-function union instrumentation

Open artemagvanian opened this issue 1 year ago • 0 comments

This PR introduces support for memory initialization checks for unions passed across the function boundary.

Whenever a union is passed as an argument, we need to make sure that its initialization state is preserved. Unlike pointers, unions do not have a stable memory address which could identify them in shadow memory. Hence, we need to pass extra information across function boundary since unions are passed “by value”.

We introduce a global variable to store the previous address of unions passed as function arguments, which allows us to effectively tie the initialization state of unions passed between functions. This struct is written to by the caller and read from by the callee.

For more information about planned functionality, see https://github.com/model-checking/kani/issues/3300

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

artemagvanian avatar Aug 27 '24 17:08 artemagvanian