don't merge "this"

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@550 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 40595a91b1
commit 511dee5e74
  1. 10
      jode/jode/flow/StructuredBlock.java

@ -72,6 +72,7 @@ public abstract class StructuredBlock {
* The analyzation is done in makeDeclaration * The analyzation is done in makeDeclaration
*/ */
VariableSet declare; VariableSet declare;
VariableSet done;
/** /**
* The surrounding structured block. If this is the outermost * The surrounding structured block. If this is the outermost
@ -418,6 +419,7 @@ public abstract class StructuredBlock {
* @param done The set of the already declare variables. * @param done The set of the already declare variables.
*/ */
public void makeDeclaration(VariableSet done) { public void makeDeclaration(VariableSet done) {
this.done = (VariableSet) done.clone();
declare = new VariableSet(); declare = new VariableSet();
java.util.Enumeration enum = used.elements(); java.util.Enumeration enum = used.elements();
next_used: next_used:
@ -439,8 +441,12 @@ public abstract class StructuredBlock {
* One bad thing that may happen is that the name * One bad thing that may happen is that the name
* of prevLocal (it has already a name) doesn't match * of prevLocal (it has already a name) doesn't match
* the intersected type. * the intersected type.
*
* A special case: this mustn't be merged, since it is
* special. "this" can't be assigned to.
*/ */
if (prevLocal.getType().isOfType(local.getType())) { if (prevLocal.getType().isOfType(local.getType())
&& prevLocal.getName() != "this") {
local.combineWith(prevLocal); local.combineWith(prevLocal);
continue next_used; continue next_used;
} }
@ -538,6 +544,8 @@ public abstract class StructuredBlock {
if (jode.Decompiler.isDebugging) { if (jode.Decompiler.isDebugging) {
if (declare != null) if (declare != null)
writer.println("declaring: "+declare); writer.println("declaring: "+declare);
if (done != null)
writer.println("done: "+done);
writer.println("using: "+used); writer.println("using: "+used);
} }

Loading…
Cancel
Save