[cfe-dev] CSA: Getting the array subscripts which lead to uninitialized reads

themod 1302 via cfe-dev cfe-dev at lists.llvm.org
Fri Dec 15 01:07:36 PST 2017


Hello everyone,

suppose I have an array, which has some uninitialized elements like in the
following example:

int array[4];
array[0] = array[1] = array[2] = 0;
for (int i = 0; i < 4; ++i) {
  // read array[i] here
}

In my checker, I want to get all the values for i, which lead to
uninitialized reads. In the example that would be 3.
Dumping the ProgramState shows me that value:
 (i,0,direct) : 3 S32b
But how can I get it in my code?

Thanks, Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20171215/1a5cb1e0/attachment.html>


More information about the cfe-dev mailing list