Skip to content

[pull] master from joernio:master #131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fixing NPE (joernio#811)
* Fixing NPE

* scalfmt
  • Loading branch information
itsacoderepo authored Dec 10, 2021
commit 92a8f31659237ea903abcf47eeb2db59aa48ef85
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ import ghidra.util.task.TaskMonitor
import io.joern.ghidra2cpg.passes._
import io.joern.ghidra2cpg.passes.arm.ArmFunctionPass
import io.joern.ghidra2cpg.passes.mips.{LoHiPass, MipsFunctionPass}
import io.joern.ghidra2cpg.passes.x86.{X86FunctionPass, ReturnEdgesPass}
import io.joern.ghidra2cpg.passes.x86.{ReturnEdgesPass, X86FunctionPass}
import io.shiftleft.codepropertygraph.Cpg
import io.shiftleft.passes.KeyPoolCreator
import io.shiftleft.x2cpg.X2Cpg
import utilities.util.FileUtilities

import java.io.File
import scala.collection.mutable
import scala.collection.mutable.ListBuffer
import scala.jdk.CollectionConverters._

class Ghidra2Cpg() {
Expand Down Expand Up @@ -191,7 +192,7 @@ object Types {

// Types will be added to the CPG as soon as everything
// else is done
val types: mutable.SortedSet[String] = scala.collection.mutable.SortedSet[String]()
val types: ListBuffer[String] = ListBuffer[String]()
def registerType(typeName: String): String = {
types += typeName
typeName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class TypesPass(cpg: Cpg) extends CpgPass(cpg) {

override def run(): Iterator[DiffGraph] = {
implicit val diffGraph: DiffGraph.Builder = DiffGraph.newBuilder
Types.types
Types.types.sorted.distinct
.foreach { typ =>
val typeNode =
nodes.NewType().name(typ).fullName(typ).typeDeclFullName(typ)
Expand Down