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
stable
delwi 26 years ago
parent 52a1f6fe06
commit aeaef2a9f9
  1. 6
      jode/jode/flow/SequentialBlock.java

@ -106,11 +106,15 @@ public class SequentialBlock extends StructuredBlock {
subBlocks[0].used.unionExact(used);
subBlocks[0].makeDeclaration(done);
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. */
VariableSet doneFirst = (VariableSet) done.clone();
doneFirst = (VariableSet) done.clone();
doneFirst.unionExact(subBlocks[0].used);
} else
doneFirst = done;
subBlocks[1].makeDeclaration(doneFirst);
}

Loading…
Cancel
Save