From 7a81c37f5cd6ed52492ccd0c8c3a497589c717b4 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Fri, 23 Aug 2019 13:31:31 +0300 Subject: [PATCH] [FIR] Fix building cfg for binary or --- .../kotlin/fir/resolve/dfa/cfg/ControlFlowGraphBuilder.kt | 1 - .../resolve/testData/resolve/cfg/binaryOperations.cfg.dot | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphBuilder.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphBuilder.kt index a15588c8a6d..0a213e3e3a8 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphBuilder.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphBuilder.kt @@ -305,7 +305,6 @@ class ControlFlowGraphBuilder : ControlFlowGraphNodeBuilder() { assert(binaryLogicExpression.kind == FirBinaryLogicExpression.OperationKind.OR) levelCounter-- return binaryOrExitNodes.pop().also { - addEdge(lastNodes.pop(), it) addEdge(lastNodes.pop(), it) lastNodes.push(it) } diff --git a/compiler/fir/resolve/testData/resolve/cfg/binaryOperations.cfg.dot b/compiler/fir/resolve/testData/resolve/cfg/binaryOperations.cfg.dot index c5ec7519a70..7fea088dedf 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/binaryOperations.cfg.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/binaryOperations.cfg.dot @@ -27,7 +27,7 @@ subgraph test_1 { 1 -> {2}; 2 -> {3}; 3 -> {4}; - 4 -> {5 8}; + 4 -> {5}; 5 -> {8 6}; 6 -> {7}; 7 -> {8}; @@ -122,7 +122,7 @@ subgraph test_3 { 44 -> {45}; 45 -> {46}; 46 -> {47}; - 47 -> {48 54}; + 47 -> {48}; 48 -> {49}; 49 -> {51 50}; 50 -> {51}; @@ -175,7 +175,7 @@ subgraph test_4 { 69 -> {70}; 70 -> {71}; 71 -> {72}; - 72 -> {73 79}; + 72 -> {73}; 73 -> {79 74}; 74 -> {75}; 75 -> {76};