warn about type errors

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@421 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 6eb3890162
commit f5c4c1d9b3
  1. 21
      jode/jode/decompiler/LocalInfo.java

@ -68,6 +68,10 @@ public class LocalInfo {
getLocalInfo().operators.addElement(operator); getLocalInfo().operators.addElement(operator);
} }
public int getUseCount() {
return getLocalInfo().operators.size();
}
/** /**
* Combines the LocalInfo with another. This will make this * Combines the LocalInfo with another. This will make this
* a shadow object to the other local info. That is all member * a shadow object to the other local info. That is all member
@ -83,8 +87,8 @@ public class LocalInfo {
} else { } else {
if (this != li) { if (this != li) {
shadow = li; shadow = li;
// Decompiler.err.println("combining "+name+"("+type+") and " // Decompiler.err.println("combining "+name+"("+type+") and "
// +li.name+"("+li.type+")"); // +li.name+"("+li.type+")");
li.setType(type); li.setType(type);
@ -195,12 +199,17 @@ public class LocalInfo {
* @param The new type information to be set. * @param The new type information to be set.
* @return The new type of the local. * @return The new type of the local.
*/ */
public Type setType(Type newType) { public Type setType(Type otherType) {
LocalInfo li = getLocalInfo(); LocalInfo li = getLocalInfo();
newType = li.type.intersection(newType); Type newType = li.type.intersection(otherType);
if (Decompiler.isTypeDebugging) if (newType == Type.tError
&& otherType != Type.tError && li.type != Type.tError)
Decompiler.err.println("Type error in local " + getName()+": "
+ li.type + " and " + otherType);
else if (Decompiler.isTypeDebugging)
Decompiler.err.println(getName()+" setType, new: "+newType Decompiler.err.println(getName()+" setType, new: "+newType
+ " old: "+li.type); + " old: "+li.type);
if (!li.type.equals(newType)) { if (!li.type.equals(newType)) {
li.type = newType; li.type = newType;
java.util.Enumeration enum = li.operators.elements(); java.util.Enumeration enum = li.operators.elements();

Loading…
Cancel
Save