[cfe-dev] How can I get the MemRegion representing an index of an array in Clang Static Analyzer?

Arthur Yoo phjy007 at gmail.com
Wed May 7 05:09:19 PDT 2014


Hi all,

I want to get the MemRegion representing an index of an array in my
checker. For example:

1 void func() {

2     int a, b, arr[10][10];

3     a = 2;

4     b = 3;

3    arr[a][1] = 3;

4 }



In the CheckLocation() method for checking the store operation at line
3 ‘*arr[a][1]
= 3;*’, I want to get the MemRegion and SVal of variable *a*, which is the
index of the array. Is there any way to get the corresponding MemRegion and
SVal of variable *a. *

My previous mail post on a related problem is
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-April/036205.html.
Unfortunately, there was no reply or solution. In fact, this problem has
trapped me for several weeks. So I really need help.

Any help would be greatly appreciated.

-- 
Best regards,
Arthur Yoo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140507/9d8cca93/attachment.html>


More information about the cfe-dev mailing list