From b462a21ed620992f79c0c497c89be683dac7c078 Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 20 Jul 1999 16:10:34 +0000 Subject: [PATCH] bug fix for exceptionLocal == null case git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1099 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/flow/CatchBlock.java.in | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/jode/jode/flow/CatchBlock.java.in b/jode/jode/flow/CatchBlock.java.in index 43cf256..bc24007 100644 --- a/jode/jode/flow/CatchBlock.java.in +++ b/jode/jode/flow/CatchBlock.java.in @@ -145,20 +145,22 @@ public class CatchBlock extends StructuredBlock { * If we are unlucky the exceptionLocal is used outside of * this block. In that case we do a transformation. */ - if (declare.contains(exceptionLocal)) - declare.remove(exceptionLocal); - else { - LocalInfo dummyLocal = new LocalInfo(); - Expression store = new StoreInstruction - (new LocalStoreOperator - (exceptionLocal.getType(), exceptionLocal)).addOperand - (new LocalLoadOperator(dummyLocal.getType(), - null, dummyLocal)); - InstructionBlock ib = new InstructionBlock(store); - ib.setFlowBlock(flowBlock); - ib.appendBlock(catchBlock); - catchBlock = ib; - exceptionLocal = dummyLocal; + if (exceptionLocal != null) { + if (declare.contains(exceptionLocal)) + declare.remove(exceptionLocal); + else { + LocalInfo dummyLocal = new LocalInfo(); + Expression store = new StoreInstruction + (new LocalStoreOperator + (exceptionLocal.getType(), exceptionLocal)).addOperand + (new LocalLoadOperator(dummyLocal.getType(), + null, dummyLocal)); + InstructionBlock ib = new InstructionBlock(store); + ib.setFlowBlock(flowBlock); + ib.appendBlock(catchBlock); + catchBlock = ib; + exceptionLocal = dummyLocal; + } } }