From 2606a10a5c3df4d5318e47e0ace5614c10fcb20c Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 15 Jan 1999 10:59:45 +0000 Subject: [PATCH] work around for jikes git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@154 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/flow/TransformExceptionHandlers.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/jode/jode/flow/TransformExceptionHandlers.java b/jode/jode/flow/TransformExceptionHandlers.java index b29b728..f046d41 100644 --- a/jode/jode/flow/TransformExceptionHandlers.java +++ b/jode/jode/flow/TransformExceptionHandlers.java @@ -850,8 +850,16 @@ public class TransformExceptionHandlers { FlowBlock catchFlow = flows[handlerPCs[i]]; while (catchFlow.analyze(handlerPCs[i], endHandler)); - if (!catchFlow.predecessors.isEmpty()) - throw new AssertError("Handler has a predecessors"); + if (!catchFlow.predecessors.isEmpty()) { + /* This can actually happen, namely in code compiled by + * jikes. In this case the predecessor is a nop and has + * no further predecessors. + */ + if (catchFlow.predecessors.size() != 1 + && ((FlowBlock)catchFlow.predecessors.elementAt(0)) + .predecessors.size() != 0) + throw new AssertError("Handler has a predecessors"); + } updateInOutCatch(tryFlow, catchFlow); if (types[i] != null)