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. 14
      jode/jode/flow/SequentialBlock.java

@ -106,11 +106,15 @@ public class SequentialBlock extends StructuredBlock {
subBlocks[0].used.unionExact(used); subBlocks[0].used.unionExact(used);
subBlocks[0].makeDeclaration(done); subBlocks[0].makeDeclaration(done);
/* Now add the variables used in the first block to the done VariableSet doneFirst;
* set of the second block, since the first sub block has if (subBlocks[0] instanceof InstructionBlock) {
* declared them. */ /* Now add the variables used in the first block to the done
VariableSet doneFirst = (VariableSet) done.clone(); * set of the second block, since the first sub block has
doneFirst.unionExact(subBlocks[0].used); * declared them. */
doneFirst = (VariableSet) done.clone();
doneFirst.unionExact(subBlocks[0].used);
} else
doneFirst = done;
subBlocks[1].makeDeclaration(doneFirst); subBlocks[1].makeDeclaration(doneFirst);
} }

Loading…
Cancel
Save