More precise value reassignment analysis. #KT-7418 Fixed. #KT-6902 Fixed.

Variable can now be "exactly initialized", "may be initialized" and "not initialized".
A set of relevant tests. Some fixed tests.
This commit is contained in:
Mikhail Glukhikh
2015-09-01 19:16:27 +03:00
parent c59b118b09
commit 285d5d06c7
26 changed files with 269 additions and 53 deletions
@@ -23,9 +23,9 @@ L0:
v(i) INIT: in: {numbers=ID} out: {i=D, numbers=ID}
L2 [loop entry point]:
L6 [condition entry point]:
jmp?(L3) INIT: in: {i=D, numbers=ID} out: {i=D, numbers=ID}
jmp?(L3) INIT: in: {i=I?D, numbers=ID} out: {i=I?D, numbers=ID}
magic[LOOP_RANGE_ITERATION](numbers|<v1>) -> <v2>
w(i|<v2>) INIT: in: {i=D, numbers=ID} out: {i=ID, numbers=ID}
w(i|<v2>) INIT: in: {i=I?D, numbers=ID} out: {i=ID, numbers=ID}
mark(for (i in numbers) { val b: Boolean if (1 < 2) { b = false } else { b = true } use(b) continue }) INIT: in: {i=ID, numbers=ID} out: {i=ID, numbers=ID} USE: in: {} out: {}
L4 [body entry point]:
4 mark({ val b: Boolean if (1 < 2) { b = false } else { b = true } use(b) continue })
@@ -53,7 +53,7 @@ L8 ['if' expression result]:
- 3 jmp(L2)
L3 [loop exit point]:
L5 [body exit point]:
read (Unit) INIT: in: {i=D, numbers=ID} out: {i=D, numbers=ID}
read (Unit) INIT: in: {i=I?D, numbers=ID} out: {i=I?D, numbers=ID}
L1:
1 <END> INIT: in: {numbers=ID} out: {numbers=ID}
error: