Skip to content

Commit

Permalink
bump versions and minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxology committed Nov 1, 2023
1 parent 2d3f85b commit 66d1d87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 28 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ ThisBuild / scalaVersion := "3.3.0"
ThisBuild / version := sys.env.getOrElse("BUILD_VERSION", "dev-SNAPSHOT")
// parsed by project/Versions.scala, updated by updateDependencies.sh

val cpgVersion = "1.4.24"
val joernVersion = "2.0.134"
val cpgVersion = "1.4.25"
val joernVersion = "2.0.137"
val overflowdbVersion = "1.181"
val requests = "0.8.0"
val upickle = "3.1.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import io.joern.x2cpg.Defines as XDefines
import io.shiftleft.codepropertygraph.generated.{EdgeTypes, NodeTypes, Operators, PropertyNames}
import io.shiftleft.semanticcpg.language.operatorextension.OpNodes.{Assignment, FieldAccess}
import overflowdb.BatchedUpdate.DiffGraphBuilder
import io.joern.x2cpg.passes.frontend.XTypeRecovery.AllNodeTypesFromNodeExt

import scala.annotation.tailrec
import scala.collection.{Seq, mutable}
Expand Down Expand Up @@ -586,32 +587,7 @@ private class RecoverForRubyFile(
case None =>
}
}

override protected def handlePotentialFunctionPointer(
funcPtr: Expression,
baseTypes: Set[String],
funcName: String,
baseName: Option[String] = None
): Unit = {
// Sometimes the function identifier is an argument to the call itself as a "base". In this case we don't need
// a method ref. This happens in jssrc2cpg
if (!funcPtr.astParent.iterator.collectAll[Call].exists(_.name == funcName)) {
baseTypes
.map(t => if (t.endsWith(funcName)) t else s"$t$pathSep$funcName")
.flatMap(cpg.method.fullNameExact)
.filterNot(m => addedNodes.contains(s"${funcPtr.id()}${NodeTypes.METHOD_REF}$pathSep${m.fullName}"))
.map(m => m -> createMethodRef(baseName, funcName, m.fullName, funcPtr.lineNumber, funcPtr.columnNumber))
.foreach { case (m, mRef) =>
funcPtr.astParent
.filterNot(_.astChildren.isMethodRef.exists(_.methodFullName == mRef.methodFullName))
.foreach { inCall =>
state.changesWereMade.compareAndSet(false, true)
integrateMethodRef(funcPtr, m, mRef, inCall)
}
}
}
}


private def integrateMethodRef(funcPtr: Expression, m: Method, mRef: NewMethodRef, inCall: AstNode) = {
builder.addNode(mRef)
builder.addEdge(mRef, m, EdgeTypes.REF)
Expand Down

0 comments on commit 66d1d87

Please sign in to comment.