[K/N][optmz] Fixed a bug with singletons in the call graph

This commit is contained in:
Igor Chevdar
2022-10-31 12:25:24 +02:00
committed by Space Team
parent c6ef3d849e
commit 97a2ee6f2f
@@ -111,7 +111,13 @@ internal class CallGraphBuilder(
is DataFlowIR.Node.Call -> block(node, node)
is DataFlowIR.Node.Singleton ->
node.constructor?.let { block(DataFlowIR.Node.Call(it, node.arguments ?: emptyList(), node.type, null), node) }
node.constructor?.let { constructor ->
val arguments = buildList {
add(DataFlowIR.Edge(node, null)) // this.
node.arguments?.let { addAll(it) }
}
block(DataFlowIR.Node.Call(constructor, arguments, node.type, null), node)
}
is DataFlowIR.Node.ArrayRead ->
block(DataFlowIR.Node.Call(