Add try/catch block around method transformations

This commit is contained in:
Denis Zharkov
2016-06-28 15:27:30 +03:00
parent c2ac49ec96
commit ae46c726fc
@@ -58,6 +58,7 @@ public abstract class TransformationMethodVisitor extends MethodVisitor {
super.visitEnd(); super.visitEnd();
try {
if (shouldBeTransformed(methodNode)) { if (shouldBeTransformed(methodNode)) {
performTransformations(methodNode); performTransformations(methodNode);
} }
@@ -78,6 +79,10 @@ public abstract class TransformationMethodVisitor extends MethodVisitor {
delegate.visitEnd(); delegate.visitEnd();
} }
catch (Throwable t) {
throw new CompilationException("Couldn't transform method node: " + InlineCodegenUtil.getNodeText(methodNode), t, null);
}
}
protected abstract void performTransformations(@NotNull MethodNode methodNode); protected abstract void performTransformations(@NotNull MethodNode methodNode);