JVM_IR: mark the exception local as live only after the store
Otherwise, should the local coincide with another one, the incorrect range causes D8 to generate invalid bytecode in debug mode.
This commit is contained in:
+2
-5
@@ -824,6 +824,7 @@ class ExpressionCodegen(
|
||||
val index = frameMap.enter(clause.catchParameter, descriptorType)
|
||||
clause.markLineNumber(true)
|
||||
mv.store(index, descriptorType)
|
||||
val afterStore = markNewLabel()
|
||||
|
||||
val catchBody = clause.result
|
||||
val catchResult = catchBody.accept(this, data)
|
||||
@@ -837,11 +838,7 @@ class ExpressionCodegen(
|
||||
frameMap.leave(clause.catchParameter)
|
||||
|
||||
val clauseEnd = markNewLabel()
|
||||
|
||||
mv.visitLocalVariable(
|
||||
parameter.name.asString(), descriptorType.descriptor, null, clauseStart, clauseEnd,
|
||||
index
|
||||
)
|
||||
mv.visitLocalVariable(parameter.name.asString(), descriptorType.descriptor, null, afterStore, clauseEnd, index)
|
||||
|
||||
if (tryInfo is TryWithFinallyInfo) {
|
||||
data.handleBlock { genFinallyBlock(tryInfo, tryCatchBlockEnd, null, data) }
|
||||
|
||||
Reference in New Issue
Block a user