Skip to content

Commit 52398e3

Browse files
committed
inter x intra procedural
1 parent 563bdb3 commit 52398e3

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ scalaVersion := "2.12.8"
22

33
name := "svfa-scala"
44
organization := "br.unb.cic"
5-
version := "0.0.7-SNAPSHOT"
5+
version := "0.0.8-SNAPSHOT"
66

77
githubOwner := "rbonifacio"
88
githubRepository := "svfa-scala"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package br.unb.cic.soot.svfa.jimple
2+
3+
trait Analysis {
4+
def interproceduralAnalysis() : Boolean
5+
def intraproceduralAnalysis() : Boolean = ! interproceduralAnalysis()
6+
}
7+
8+
trait InterproceduralAnalysis extends Analysis {
9+
override def interproceduralAnalysis(): Boolean = true
10+
}
11+
12+
trait IntraproceduralAnalysis extends Analysis {
13+
override def interproceduralAnalysis(): Boolean = false
14+
}

src/main/scala/br/unb/cic/soot/svfa/jimple/JSVFA.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import scala.collection.mutable.ListBuffer
2121
* A Jimple based implementation of
2222
* SVFA.
2323
*/
24-
abstract class JSVFA extends SVFA with FieldSensitiveness with SourceSinkDef with LazyLogging {
24+
abstract class JSVFA extends SVFA with Analysis with FieldSensitiveness with SourceSinkDef with LazyLogging {
2525

2626
var methods = 0
2727
val traversedMethods = scala.collection.mutable.Set.empty[SootMethod]
@@ -196,6 +196,8 @@ abstract class JSVFA extends SVFA with FieldSensitiveness with SourceSinkDef wit
196196
return
197197
}
198198

199+
if(intraproceduralAnalysis()) return
200+
199201
var pmtCount = 0
200202
val body = callee.retrieveActiveBody()
201203
val g = new ExceptionalUnitGraph(body)

src/test/scala/br/unb/cic/soot/JSVFATest.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package br.unb.cic.soot
22

3-
import br.unb.cic.soot.svfa.jimple.{FieldSenstive, JSVFA}
3+
import br.unb.cic.soot.svfa.jimple.{FieldSenstive, InterproceduralAnalysis, JSVFA}
44
import soot.{Scene, SootMethod}
55

6-
abstract class JSVFATest extends JSVFA with FieldSenstive {
6+
abstract class JSVFATest extends JSVFA with InterproceduralAnalysis with FieldSenstive {
77
def getClassName(): String
88
def getMainMethod(): String
99

0 commit comments

Comments
 (0)