-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handing functionality off to jimple2cpg that includes many bug fixes (#…
…241) * Included jimple2cpg functionality and updated tests * Styling * Fixed driver fixture import * Fixed diff detection on operators
- Loading branch information
1 parent
51af989
commit 7c15c6c
Showing
32 changed files
with
224 additions
and
1,363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...rkjoin/PlumeForkJoinParallelCpgPass.scala → ...passes/PlumeForkJoinParallelCpgPass.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/main/scala/com/github/plume/oss/passes/base/AstCreationPass.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.github.plume.oss.passes.base | ||
|
||
import com.github.plume.oss.Jimple2Cpg | ||
import com.github.plume.oss.passes.{IncrementalKeyPool, PlumeConcurrentCpgPass} | ||
import io.joern.jimple2cpg.passes.Global | ||
import io.shiftleft.codepropertygraph.Cpg | ||
import org.slf4j.LoggerFactory | ||
import soot.Scene | ||
|
||
/** Creates the AST layer from the given class file and stores all types in the given global parameter. | ||
*/ | ||
class AstCreationPass( | ||
filenames: List[String], | ||
cpg: Cpg, | ||
keyPool: IncrementalKeyPool | ||
) extends PlumeConcurrentCpgPass[String](cpg, keyPool = Some(keyPool)) { | ||
|
||
val global: Global = Global() | ||
private val logger = LoggerFactory.getLogger(classOf[AstCreationPass]) | ||
|
||
override def generateParts(): Array[_ <: AnyRef] = filenames.toArray | ||
|
||
override def runOnPart(builder: DiffGraphBuilder, part: String): Unit = { | ||
val qualifiedClassName = Jimple2Cpg.getQualifiedClassPath(part) | ||
try { | ||
val sootClass = Scene.v().loadClassAndSupport(qualifiedClassName) | ||
sootClass.setApplicationClass() | ||
new io.joern.jimple2cpg.passes.AstCreator(part, builder, global).createAst(sootClass) | ||
} catch { | ||
case e: Exception => | ||
logger.warn(s"Cannot parse: $part ($qualifiedClassName)", e) | ||
Iterator() | ||
} | ||
} | ||
|
||
} |
7 changes: 3 additions & 4 deletions
7
...es/concurrent/PlumeContainsEdgePass.scala → ...s/passes/base/PlumeContainsEdgePass.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 5 additions & 12 deletions
17
...ithub/plume/oss/passes/PlumeCpgPass.scala → .../plume/oss/passes/base/PlumeCpgPass.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...b/plume/oss/passes/PlumeCpgPassBase.scala → ...me/oss/passes/base/PlumeCpgPassBase.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...e/oss/passes/PlumeDynamicCallLinker.scala → ...es/callgraph/PlumeDynamicCallLinker.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.