From 90ff2f600b08aba38db8edf5e1b4557b09bde211 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 7 May 1999 22:56:08 +0000 Subject: [PATCH] give up, if type changes recursively in local git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@796 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/decompiler/LocalInfo.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/jode/jode/decompiler/LocalInfo.java b/jode/jode/decompiler/LocalInfo.java index af1af8c..57c9974 100644 --- a/jode/jode/decompiler/LocalInfo.java +++ b/jode/jode/decompiler/LocalInfo.java @@ -248,6 +248,7 @@ public class LocalInfo { return getLocalInfo().type; } + private int loopCount = 0; /** * Sets a new information about the type of this local. * The type of the local is may be made more specific by this call. @@ -256,6 +257,12 @@ public class LocalInfo { */ public Type setType(Type otherType) { LocalInfo li = getLocalInfo(); + if (li.loopCount++ > 5) { + GlobalOptions.err.println("Type error in local " + getName()+": " + + li.type + " seems to be recursive."); + Thread.dumpStack(); + otherType = Type.tError; + } Type newType = li.type.intersection(otherType); if (newType == Type.tError && otherType != Type.tError && li.type != Type.tError) { @@ -277,6 +284,7 @@ public class LocalInfo { lvo.updateType(); } } + li.loopCount--; return li.type; }