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)
|
val index = frameMap.enter(clause.catchParameter, descriptorType)
|
||||||
clause.markLineNumber(true)
|
clause.markLineNumber(true)
|
||||||
mv.store(index, descriptorType)
|
mv.store(index, descriptorType)
|
||||||
|
val afterStore = markNewLabel()
|
||||||
|
|
||||||
val catchBody = clause.result
|
val catchBody = clause.result
|
||||||
val catchResult = catchBody.accept(this, data)
|
val catchResult = catchBody.accept(this, data)
|
||||||
@@ -837,11 +838,7 @@ class ExpressionCodegen(
|
|||||||
frameMap.leave(clause.catchParameter)
|
frameMap.leave(clause.catchParameter)
|
||||||
|
|
||||||
val clauseEnd = markNewLabel()
|
val clauseEnd = markNewLabel()
|
||||||
|
mv.visitLocalVariable(parameter.name.asString(), descriptorType.descriptor, null, afterStore, clauseEnd, index)
|
||||||
mv.visitLocalVariable(
|
|
||||||
parameter.name.asString(), descriptorType.descriptor, null, clauseStart, clauseEnd,
|
|
||||||
index
|
|
||||||
)
|
|
||||||
|
|
||||||
if (tryInfo is TryWithFinallyInfo) {
|
if (tryInfo is TryWithFinallyInfo) {
|
||||||
data.handleBlock { genFinallyBlock(tryInfo, tryCatchBlockEnd, null, data) }
|
data.handleBlock { genFinallyBlock(tryInfo, tryCatchBlockEnd, null, data) }
|
||||||
|
|||||||
Reference in New Issue
Block a user