Fix exponential pseudocode size on incorrect prefix increments and decrements

#KT-44153 Fixed
This commit is contained in:
Dmitriy Novozhilov
2021-03-15 18:34:28 +03:00
parent 6c5557dae3
commit cef859fced
10 changed files with 161 additions and 20 deletions
@@ -26,11 +26,10 @@ L0:
r(0) -> <v2>
magic[UNRESOLVED_CALL](a[0]|<v1>, <v2>) -> <v3>
magic[UNRESOLVED_CALL](a[0]++|<v3>) -> <v4>
magic[UNRESOLVED_CALL](a[0]++|<v3>, <v4>) -> <v5>
L1:
1 <END> NEXT:[<SINK>]
1 <END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
<SINK> PREV:[<ERROR>, <END>]
=====================
+3 -3
View File
@@ -11,6 +11,6 @@ fun foo(a: A) {
a <v1>: * NEW: r(a) -> <v1>
0 <v2>: * NEW: r(0) -> <v2>
a[0] <v3>: * NEW: magic[UNRESOLVED_CALL](a[0]|<v1>, <v2>) -> <v3>
a[0]++ <v3>: * COPY
{ a[0]++ } <v3>: * COPY
=====================
a[0]++ <v4>: * NEW: magic[UNRESOLVED_CALL](a[0]++|<v3>) -> <v4>
{ a[0]++ } <v4>: * COPY
=====================