Files
kotlin-fork/compiler/testData/checkLocalVariablesTable
Mads Ager 1e444e0451 [JVM IR] Limit local variables in do-while conditions.
Locals introduced in the body of a do-while loop are not
necessarily live at the do-while condition. For example,
if there is a continue in the body before the declaration:

    do {
      if (shouldContinue(x))
        continue
      val y = 32  // not always defined in the condition
      doSomething(y)
    } while (x < 2)

For locals referenced in the condition such code is rejected
by the frontend because a local referenced in the condition
must be always defined when you get there.

However, locals that are not used in the condition were always
put in the local variable table. This leads to invalid locals
information which can trip of debuggers and other build tools
such as the D8 dexer.

This patch only puts in locals information for locals actually
referenced in the local variable table for the condition.

^Fixes KT-51754
2022-04-12 15:47:14 +02:00
..