Proper generate interval for catch block variable; Fix for KT-15646: InconsistentDebugInfoException when stepping over throw

#KT-15646 Fixed
This commit is contained in:
Mikhael Bogdanov
2017-01-18 14:36:27 +01:00
parent 4ab6b6954d
commit e1bec0df2e
5 changed files with 49 additions and 3 deletions
@@ -4358,6 +4358,9 @@ The "returned" value of try expression with no finally is either the last expres
int index = lookupLocalIndex(descriptor);
v.store(index, descriptorType);
Label catchVariableStart = new Label();
v.mark(catchVariableStart);
gen(catchBody, expectedAsmType);
if (!isStatement) {
@@ -4369,8 +4372,8 @@ The "returned" value of try expression with no finally is either the last expres
Label clauseEnd = new Label();
v.mark(clauseEnd);
v.visitLocalVariable(descriptor.getName().asString(), descriptorType.getDescriptor(), null, clauseStart, clauseEnd,
index);
v.visitLocalVariable(descriptor.getName().asString(), descriptorType.getDescriptor(), null,
catchVariableStart, clauseEnd, index);
genFinallyBlockOrGoto(finallyBlockStackElement, i != size - 1 || finallyBlock != null ? end : null, null);