From aeaef2a9f94f4de78639d27e570c4ab8899a3fe6 Mon Sep 17 00:00:00 2001 From: delwi Date: Mon, 8 Feb 1999 16:02:28 +0000 Subject: [PATCH] Only tell the second block about variables declared in first block if the first block is a InstructionBlock git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@233 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/flow/SequentialBlock.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/jode/jode/flow/SequentialBlock.java b/jode/jode/flow/SequentialBlock.java index 4f9a30e..43907e0 100644 --- a/jode/jode/flow/SequentialBlock.java +++ b/jode/jode/flow/SequentialBlock.java @@ -106,11 +106,15 @@ public class SequentialBlock extends StructuredBlock { subBlocks[0].used.unionExact(used); subBlocks[0].makeDeclaration(done); - /* Now add the variables used in the first block to the done - * set of the second block, since the first sub block has - * declared them. */ - VariableSet doneFirst = (VariableSet) done.clone(); - doneFirst.unionExact(subBlocks[0].used); + VariableSet doneFirst; + if (subBlocks[0] instanceof InstructionBlock) { + /* Now add the variables used in the first block to the done + * set of the second block, since the first sub block has + * declared them. */ + doneFirst = (VariableSet) done.clone(); + doneFirst.unionExact(subBlocks[0].used); + } else + doneFirst = done; subBlocks[1].makeDeclaration(doneFirst); }