Skip to content

Instantly share code, notes, and snippets.

@benjholla
Last active September 22, 2016 21:59
Show Gist options
  • Save benjholla/0d1ca8392910ae7a5fb5f0de150d6591 to your computer and use it in GitHub Desktop.
Save benjholla/0d1ca8392910ae7a5fb5f0de150d6591 to your computer and use it in GitHub Desktop.
A basic Program Dependence Graph (PDG) example
/**
* Basic Program Dependence Graph (PDG) example from:
* https://www.cs.colorado.edu/~kena/classes/5828/s00/lectures/lecture15.pdf
*
* @author Ben Holland
*/
public class BasicProgramDependenceGraphExample {
public static void main(String[] args) {
/* 1 */
int i = 1;
/* 2 */
if (i == 1) {
/* 3 */
System.out.println("POS");
} else {
/* 4 */
i = 1;
}
/* 5 */
System.out.println(i + "blah");
/* 6 end */
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment