JVM we don't merge frames in stack normalization
This commit is contained in:
committed by
teamcityserver
parent
91afa3335c
commit
e72d24960d
+1
-22
@@ -179,28 +179,7 @@ internal class FixStackAnalyzer(
|
||||
}
|
||||
|
||||
override fun merge(frame: Frame<out FixStackValue>, interpreter: Interpreter<FixStackValue>): Boolean {
|
||||
val other = frame as FixStackFrame
|
||||
if (stackSizeWithExtra != other.stackSizeWithExtra) {
|
||||
throw AnalyzerException(null, "Incompatible stack heights")
|
||||
}
|
||||
var changed = false
|
||||
for (i in 0 until stackSize) {
|
||||
val v0 = super.getStack(i)
|
||||
val vm = interpreter.merge(v0, other.getStack(i))
|
||||
if (vm != v0) {
|
||||
super.setStack(i, vm)
|
||||
changed = true
|
||||
}
|
||||
}
|
||||
for (i in 0 until extraStack.size) {
|
||||
val v0 = extraStack[i]
|
||||
val vm = interpreter.merge(v0, other.extraStack[i])
|
||||
if (vm != v0) {
|
||||
extraStack[i] = vm
|
||||
changed = true
|
||||
}
|
||||
}
|
||||
return changed
|
||||
throw UnsupportedOperationException("Stack normalization should not merge frames")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
@@ -72,6 +72,9 @@ internal open class HackedFixStackMethodAnalyzerBase<V : Value>(
|
||||
fun analyze(): Array<Frame<V>?> {
|
||||
if (nInsns == 0) return frames
|
||||
|
||||
// This is a very specific version of method bytecode analyzer that doesn't perform any DFA,
|
||||
// but infers stack types for reachable instructions instead.
|
||||
|
||||
checkAssertions()
|
||||
|
||||
computeExceptionEdges()
|
||||
|
||||
Reference in New Issue
Block a user