From aca789beedde948031d257a21365f28891fa03d0 Mon Sep 17 00:00:00 2001 From: hoenicke Date: Wed, 11 Jul 2001 13:12:54 +0000 Subject: [PATCH] * jode/flow/CatchBlock.java.in (combineLocal): Added more checks if LocalStoreOperator is of the right form. git-svn-id: https://svn.code.sf.net/p/jode/code/branches/branch_1_1@1326 379699f6-c40d-0410-875b-85095c16579e --- jode/ChangeLog | 5 +++++ jode/jode/flow/CatchBlock.java.in | 25 ++++++++++++++----------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/jode/ChangeLog b/jode/ChangeLog index eb0f245..fd71aea 100644 --- a/jode/ChangeLog +++ b/jode/ChangeLog @@ -1,3 +1,8 @@ +2001-07-11 Jochen Hoenicke + + * jode/flow/CatchBlock.java.in (combineLocal): Added more checks + if LocalStoreOperator is of the right form. + 2001-07-10 Jochen Hoenicke * jode/obfuscator/modules/SimpleAnalyzer.java.in: diff --git a/jode/jode/flow/CatchBlock.java.in b/jode/jode/flow/CatchBlock.java.in index 5a39548..f47d587 100644 --- a/jode/jode/flow/CatchBlock.java.in +++ b/jode/jode/flow/CatchBlock.java.in @@ -24,6 +24,7 @@ import jode.decompiler.Declarable; import jode.expr.Expression; import jode.expr.LocalLoadOperator; import jode.expr.LocalStoreOperator; +import jode.expr.NopOperator; import jode.expr.StoreInstruction; import jode.util.SimpleSet; @@ -218,17 +219,19 @@ public class CatchBlock extends StructuredBlock { } else if (firstInstr instanceof InstructionBlock) { Expression instr = ((InstructionBlock) firstInstr).getInstruction(); - if (instr instanceof StoreInstruction - && (((StoreInstruction)instr).getLValue() - instanceof LocalStoreOperator)) { - /* The exception is stored in a local variable */ - exceptionLocal = ((LocalStoreOperator) - ((StoreInstruction)instr).getLValue()) - .getLocalInfo(); - exceptionLocal.setType(exceptionType); - firstInstr.removeBlock(); - return true; - } + if (instr instanceof StoreInstruction) { + StoreInstruction store = (StoreInstruction) instr; + if (store.getOperatorIndex() == store.OPASSIGN_OP + && store.getSubExpressions()[1] instanceof NopOperator + && store.getLValue() instanceof LocalStoreOperator) { + /* The exception is stored in a local variable */ + exceptionLocal = ((LocalStoreOperator) store.getLValue()) + .getLocalInfo(); + exceptionLocal.setType(exceptionType); + firstInstr.removeBlock(); + return true; + } + } } return false; }