Skip to content

Commit ff5a180

Browse files
[swiftsrc2cpg] Fix AST edge creation for typerefs (#5595)
1 parent 121ea29 commit ff5a180

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForDeclSyntaxCreator.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ trait AstForDeclSyntaxCreator(implicit withSchemaValidation: ValidationMode) {
337337

338338
val typeRefNode_ = typeRefNode(node, code(node), typeFullName)
339339
methodAstParentStack.find(_.isInstanceOf[NewMethod]).foreach { node =>
340-
diffGraph.addEdge(methodAstParentStack.head, typeRefNode_, EdgeTypes.AST)
340+
diffGraph.addEdge(node, typeRefNode_, EdgeTypes.AST)
341341
}
342342

343343
methodAstParentStack.push(typeDeclNode_)
@@ -489,7 +489,7 @@ trait AstForDeclSyntaxCreator(implicit withSchemaValidation: ValidationMode) {
489489

490490
val typeRefNode_ = typeRefNode(node, code(node), typeFullName)
491491
methodAstParentStack.find(_.isInstanceOf[NewMethod]).foreach { node =>
492-
diffGraph.addEdge(methodAstParentStack.head, typeRefNode_, EdgeTypes.AST)
492+
diffGraph.addEdge(node, typeRefNode_, EdgeTypes.AST)
493493
}
494494

495495
methodAstParentStack.push(typeDeclNode_)

0 commit comments

Comments
 (0)