diff --git a/pom.xml b/pom.xml
index fc850e31..8d9ed455 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
org.jetbrains.research
kfg
- 0.0.4.1
+ 0.0.4.2
UTF-8
diff --git a/src/main/kotlin/org/jetbrains/research/kfg/builder/cfg/CfgBuilder.kt b/src/main/kotlin/org/jetbrains/research/kfg/builder/cfg/CfgBuilder.kt
index ef93f3e1..ae1930c5 100644
--- a/src/main/kotlin/org/jetbrains/research/kfg/builder/cfg/CfgBuilder.kt
+++ b/src/main/kotlin/org/jetbrains/research/kfg/builder/cfg/CfgBuilder.kt
@@ -959,7 +959,7 @@ class CfgBuilder(val cm: ClassManager, val method: Method)
when (type) {
null -> removablePhis.add(phi)
else -> {
- val newPhi = instFactory.getPhi(phi.name, type, incomings)
+ val newPhi = instFactory.getPhi(type, incomings)
phi.replaceAllUsesWith(newPhi)
phi.operands.forEach { it.removeUser(phi) }
bb.replace(phi, newPhi)
@@ -1011,6 +1011,8 @@ class CfgBuilder(val cm: ClassManager, val method: Method)
}
processPhis.addAll(removablePhis)
+ // this is generally fucked up
+ processPhis.sortBy { it.name.toString() }
while (processPhis.isNotEmpty()) {
val top = processPhis.first()
processPhis.removeAt(0)
diff --git a/src/main/kotlin/org/jetbrains/research/kfg/ir/BasicBlock.kt b/src/main/kotlin/org/jetbrains/research/kfg/ir/BasicBlock.kt
index 3410ef22..f57bd6de 100644
--- a/src/main/kotlin/org/jetbrains/research/kfg/ir/BasicBlock.kt
+++ b/src/main/kotlin/org/jetbrains/research/kfg/ir/BasicBlock.kt
@@ -10,14 +10,14 @@ import org.jetbrains.research.kfg.type.Type
import org.jetbrains.research.kfg.util.GraphNode
sealed class BasicBlock(val name: BlockName)
- : UsableBlock(), Iterable, GraphNode, BlockUser {
+ : UsableBlock(), Iterable, GraphNode, BlockUser {
var parent: Method? = null
internal set(value) {
field = value
instructions.forEach { addValueToParent(it) }
}
- override val predecessors = hashSetOf()
- override val successors = hashSetOf()
+ override val predecessors = linkedSetOf()
+ override val successors = linkedSetOf()
val instructions = arrayListOf()
val handlers = arrayListOf()