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

Loading…
Cancel
Save