Exception handling fixed for the case of inner classes

This commit is contained in:
Andrey Breslav
2013-10-07 01:44:29 +04:00
parent 1dfbbb9f08
commit e1e1428f4b
+3 -3
View File
@@ -70,9 +70,9 @@ fun interpreterLoop(
fun exceptionCaught(exceptionValue: Value): Boolean {
val catchBlocks = handlers[m.instructions.indexOf(currentInsn)] ?: listOf()
for (catch in catchBlocks) {
val exceptionTypeDesc = catch.`type`
if (exceptionTypeDesc != null) {
val exceptionType = Type.getType(exceptionTypeDesc)
val exceptionTypeInternalName = catch.`type`
if (exceptionTypeInternalName != null) {
val exceptionType = Type.getObjectType(exceptionTypeInternalName)
if (eval.isInstanceOf(exceptionValue, exceptionType)) {
frame.clearStack()
frame.push(exceptionValue)