-
Notifications
You must be signed in to change notification settings - Fork 440
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
Question for source sink analysis #16
Comments
Hi Kim, SVF is built on top of LLVM compiler. It accepts LLVM IR as its inputs instead of source code. For example, "var = var + 30" will be translated into a SSA form, in which "var" will be split into two different variables on the right/left hand sides of the assignment to represent unique definitions. SVF models memory objects (including field objects of a class object, like "classA.a") at their allocations. You need to map an object to a SVFGNode, which either allocates or accesses the object, then you can perform a simple graph traversal on top SVFG to achieve your goal as described in https://github.com/unsw-corg/SVF/wiki/Write-a-source-sink-analyzer. Thanks. |
Please refer to SVFG.cpp from lines 907-1197. This is the best way to figure out nodes, edges and their colors and ids on a SVFG. For example, 23 is the id of the SVFGNode. 101<-102 in the green box denotes the address constraint (e.g., p=&q), where 101 and 102 are ids for the two variables. Finally "10 13 16 17 22 26" are five callsite ids corresponding to the five call edges highlighted in red. Note that "ander_svfg.dot" is an optimized version of SVFG (https://github.com/unsw-corg/SVF/wiki/Technical-documentation#323-svfg-optimization), you can also refer to "SVFG_before_opt.dot" for an original version of SVFG (http://www.cse.unsw.edu.au/~ysui/papers/cc16.pdf). The aim of using dot graph for us is to debug analysis built on SVFG. You can also dump SVFG into any format suitable for your purpose if you think you can draw a better one. |
Thank you. I solved this problem. So, I closed it. |
separate SCC detection totally from OCG; add statistics of subNodes i…
Make Util/Casting.h no longer depends on LLVM headers
Hi, I referred to https://github.com/unsw-corg/SVF/wiki/Write-a-source-sink-analyzer
In my case, I have two types of sources.
My target program runs in a loop, and class variable will go out via sinks.
This class variable is computed with class variable, arithmetic operations and source (external source).
In this case, is there a way to designate "class variable" as sources?
From my observation, some node contains variable names. So, if I could get such node in some way, there may be some way to do. But I am not sure.
Note that class variable can be changed directly via arithmetic operations (e.g., classA.a = classA.a + 30)
The text was updated successfully, but these errors were encountered: