Skip to content

Assignment 4

Xiao edited this page Sep 25, 2024 · 19 revisions

Assignment-4 folder layout

$tree Assignment-4
|-- Assignment-4.cpp
|-- Assignment-4.h
|-- CMakeLists.txt
|-- Test4.cpp
`-- testcase
    |-- bc
    |   |-- test1.ll
    `-- src
        |-- test1.c

1. Get the latest Assignment-4 code template

Make sure to switch your program to assign-4 before coding.

2. Assignment 4 task

  1. Implement readSrcSnkFromFile, printICFGPath and aliasCheck of class TaintGraphTraversal in Assignment-4.cpp
  2. Pass the test without any assertion by Test4.cpp
  3. Submit Assignment-4.cpp to canvas. Your implementation will be evaluated against our 10 internal tests. You will get the full marks if your code can pass them all. Unfortunately, our internal tests are publicly available. Here, we only provided limited test cases in Test4.cpp. You are encouraged to add more test cases by yourself to validate the correctness of your implementation.

SVF APIs to help with your implementation SVF CPP API.

*You will be working on Assignment-4.cpp only and there is NO need to modify other files under the Assignment-4 folder

3. Debugging and test cases.

We provided two test cases with their corresponding LLVM bc files.

Make sure you previously implemented Assignment-2.cpp and Assignment-3.cpp are in place. Class TaintGraphTraversal is a child class of ICFGTraversal and will use the DFS method implemented in Assignment 2 for control-flow traversal. Andersen's analysis implemented in Assignment 3 will also be used for checking aliases between two pointers.

  • readSrcSnkFromFile: general C++ file reading link1, link2, link3 or link4.
  • printICFGPath : similar to printICFGPath in Assignments 2 and 3.
  • aliasCheck: please follow the SVF APIs link1, link2, and link3