Do not evaluate label instructions and such

This commit is contained in:
Andrey Breslav
2013-10-06 13:52:39 +04:00
parent b926e79aac
commit 0aca17ce15
+7 -2
View File
@@ -67,7 +67,8 @@ fun interpreterLoop(
// skip to the next instruction // skip to the next instruction
} }
else -> when (insnOpcode) { else -> {
when (insnOpcode) {
GOTO -> { GOTO -> {
goto((currentInsn as JumpInsnNode).label) goto((currentInsn as JumpInsnNode).label)
continue continue
@@ -106,7 +107,9 @@ fun interpreterLoop(
if (handled != null) return handled if (handled != null) return handled
return ExceptionThrown(exceptionValue) return ExceptionThrown(exceptionValue)
} }
}
// Workaround for a bug in Kotlin: NoPatterMatched exception is thrown otherwise!
else -> {}
} }
try { try {
@@ -118,6 +121,8 @@ fun interpreterLoop(
if (handled != null) return handled if (handled != null) return handled
return ExceptionThrown(e.exception) return ExceptionThrown(e.exception)
} }
}
}
val handled = handler.instructionProcessed(currentInsn) val handled = handler.instructionProcessed(currentInsn)
if (handled != null) return handled if (handled != null) return handled