From f5c4c1d9b359c7ac733014823adaea2eeb79c6d6 Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 15 Mar 1999 17:55:53 +0000 Subject: [PATCH] warn about type errors git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@421 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/decompiler/LocalInfo.java | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/jode/jode/decompiler/LocalInfo.java b/jode/jode/decompiler/LocalInfo.java index aeb0e1e..0a34f28 100644 --- a/jode/jode/decompiler/LocalInfo.java +++ b/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();