KT-16713 Insufficient maximum stack size

1. Analyze method node with fake jumps for loops to make sure that
all instructions reachable only through break/continue jumps are processed.
2. Fix stack for break/continue jumps.
3. Drop fake jumps for loops, analyze method node again.
4. Fix stack for try/catch and beforeInline.
This commit is contained in:
Dmitry Petrov
2017-03-07 18:58:52 +03:00
committed by Mikhael Bogdanov
parent 80063b6f91
commit 11caa03427
10 changed files with 177 additions and 27 deletions
@@ -0,0 +1,30 @@
class MyQueue {
fun poll(): String? = null
}
class A {
val delayedQueue = MyQueue()
fun next() {
while (true) {
delayedQueue.poll() ?: break
}
while (true) {
unblock(delayedQueue.poll() ?: break)
}
while (true) {
unblock(delayedQueue.poll() ?: break)
}
}
fun unblock(p: String) {
}
}
fun box() : String {
A().next()
return "OK"
}
@@ -0,0 +1,32 @@
class MyQueue {
fun poll(): String? = null
}
class A {
val delayedQueue = MyQueue()
var cond = true
fun next() {
while (cond) {
delayedQueue.poll() ?: break
}
while (cond) {
unblock(delayedQueue.poll() ?: break)
}
while (cond) {
unblock(delayedQueue.poll() ?: break)
}
}
fun unblock(p: String) {
}
}
fun box() : String {
A().next()
return "OK"
}