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

Improve/fix array/pointer support in dizy #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ClearlyClaire
Copy link
Contributor

Hi,
There are a few issues preventing dizy from working correctly with arrays.

  • The first one is that only integer arguments are considered equal, and not pointer arguments.
    Thus, dizy cannot infer any meaningful relation between accesses of the same input array in the original and modified version of the program, thus badly affecting dizy's precision when one of the input parameters is a pointer. This is fixed in the first commit by extending initial value handling to pointer values, as it is done in SCORE.
  • The second issue is that only pointer values are considered arrays. However, LLVM distinguishes between pointer values and arrays. This leads to various issues affecting both precision and soundness. This is addressed in the second commit.

On a side note, “ccc” may produce incorrect correlating programs by aliasing pointers from the original version and the modified version together. While it might be mitigated by dizy's rules (I haven't checked yet), it is still a fundamental issue with “ccc”. This is not a fundamental problem with SCORE (I haven't checked how the implementation handles it, though).

…core

Previously, dizy only took into account variable initialization for integer
variables. Extend this to pointer variables, as in SCORE, in order for array
parameters to be correctly aliased.
dizy handles array access by discriminating against the type of the lvalue
and the rvalue, and checking whether they are pointer types.
However, LLVM makes a distinction between pointer values (int *foo) and array
values (int foo[2]). Therefore, on the following piece of code:
  int foo[2];
  foo[x] = 42;
dizy would lead to the following nonsensical interpretation:
  { foo - 42 = 0 }
instead of:
  { update( foo , idx ) - 42 = 0
    idx - 2 = 0 }
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

Successfully merging this pull request may close these issues.

1 participant