Java: IPA the CFG

This commit is contained in:
Owen Mansel-Chan
2024-11-12 17:01:51 +00:00
parent 0f5786e4e6
commit 0f3dd6d8f1
79 changed files with 455 additions and 348 deletions

View File

@@ -1,7 +1,7 @@
| Test.java:3:14:3:17 | { ... } | 0 | Test.java:3:14:3:17 | { ... } |
| Test.java:3:14:3:17 | { ... } | 1 | Test.java:3:14:3:17 | super(...) |
| Test.java:3:14:3:17 | { ... } | 2 | Test.java:3:14:3:17 | Test |
| Test.java:4:14:4:17 | test | 0 | Test.java:4:14:4:17 | test |
| Test.java:3:14:3:17 | { ... } | 2 | Test.java:3:14:3:17 | Exit |
| Test.java:4:14:4:17 | Exit | 0 | Test.java:4:14:4:17 | Exit |
| Test.java:4:21:76:2 | { ... } | 0 | Test.java:4:21:76:2 | { ... } |
| Test.java:4:21:76:2 | { ... } | 1 | Test.java:5:3:5:12 | var ...; |
| Test.java:4:21:76:2 | { ... } | 2 | Test.java:5:11:5:11 | 0 |

View File

@@ -3,5 +3,5 @@ import default
from BasicBlock b, ControlFlowNode n, int i
where
b.getNode(i) = n and
b.getFile().(CompilationUnit).fromSource()
b.getEnclosingCallable().getFile().(CompilationUnit).fromSource()
select b, i, n

View File

@@ -1,4 +1,4 @@
| Test.java:4:21:76:2 | { ... } | Test.java:4:14:4:17 | test |
| Test.java:4:21:76:2 | { ... } | Test.java:4:14:4:17 | Exit |
| Test.java:4:21:76:2 | { ... } | Test.java:11:14:14:3 | { ... } |
| Test.java:4:21:76:2 | { ... } | Test.java:14:10:16:3 | { ... } |
| Test.java:4:21:76:2 | { ... } | Test.java:18:3:18:8 | <Expr>; |
@@ -20,7 +20,7 @@
| Test.java:4:21:76:2 | { ... } | Test.java:60:12:62:5 | { ... } |
| Test.java:4:21:76:2 | { ... } | Test.java:63:9:66:4 | { ... } |
| Test.java:4:21:76:2 | { ... } | Test.java:70:3:70:9 | <Expr>; |
| Test.java:18:3:18:8 | <Expr>; | Test.java:4:14:4:17 | test |
| Test.java:18:3:18:8 | <Expr>; | Test.java:4:14:4:17 | Exit |
| Test.java:18:3:18:8 | <Expr>; | Test.java:22:4:22:10 | <Expr>; |
| Test.java:18:3:18:8 | <Expr>; | Test.java:24:4:24:10 | return ... |
| Test.java:18:3:18:8 | <Expr>; | Test.java:30:15:33:3 | { ... } |

View File

@@ -6,7 +6,7 @@
| Test.java:18:3:18:8 | <Expr>; | Test.java:24:4:24:10 | return ... |
| Test.java:22:4:22:10 | <Expr>; | Test.java:30:15:33:3 | { ... } |
| Test.java:22:4:22:10 | <Expr>; | Test.java:35:3:35:9 | <Expr>; |
| Test.java:24:4:24:10 | return ... | Test.java:4:14:4:17 | test |
| Test.java:24:4:24:10 | return ... | Test.java:4:14:4:17 | Exit |
| Test.java:30:15:33:3 | { ... } | Test.java:35:3:35:9 | <Expr>; |
| Test.java:35:3:35:9 | <Expr>; | Test.java:38:9:38:9 | x |
| Test.java:38:9:38:9 | x | Test.java:38:16:41:3 | { ... } |
@@ -27,4 +27,4 @@
| Test.java:57:15:60:5 | { ... } | Test.java:70:3:70:9 | <Expr>; |
| Test.java:60:12:62:5 | { ... } | Test.java:54:26:54:26 | j |
| Test.java:63:9:66:4 | { ... } | Test.java:54:26:54:26 | j |
| Test.java:70:3:70:9 | <Expr>; | Test.java:4:14:4:17 | test |
| Test.java:70:3:70:9 | <Expr>; | Test.java:4:14:4:17 | Exit |

View File

@@ -2,5 +2,5 @@ import default
import semmle.code.java.controlflow.Dominance
from Stmt pre, Stmt post
where strictlyDominates(pre, post)
where strictlyDominates(pre.getControlFlowNode(), post.getControlFlowNode())
select pre, post

View File

@@ -2,5 +2,5 @@ import default
import semmle.code.java.controlflow.Dominance
from Stmt pre, Stmt post
where strictlyPostDominates(post, pre)
where strictlyPostDominates(post.getControlFlowNode(), pre.getControlFlowNode())
select post, pre