From 36892f2475df204705f75419214f12cc652ddecc Mon Sep 17 00:00:00 2001 From: delwi Date: Mon, 8 Feb 1999 16:01:15 +0000 Subject: [PATCH] New anonymous (no slot) locals git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@229 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/decompiler/LocalInfo.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/jode/jode/decompiler/LocalInfo.java b/jode/jode/decompiler/LocalInfo.java index 803a67f..33ca21a 100644 --- a/jode/jode/decompiler/LocalInfo.java +++ b/jode/jode/decompiler/LocalInfo.java @@ -35,6 +35,7 @@ import jode.decompiler.LocalVarOperator; */ public class LocalInfo { private static int serialnr = 0; + private static int nextAnonymousSlot = -1; private int slot; private boolean isUnique; private String name; @@ -42,12 +43,17 @@ public class LocalInfo { private LocalInfo shadow; private Vector operators = new Vector(); - /* The current implementation may use very much stack. This - * should be changed someday. + /** + * Create a new local info with an anonymous slot. */ + public LocalInfo() { + name = null; + type = Type.tUnknown; + this.slot = nextAnonymousSlot--; + } /** - * Create a new local info. The name will be a string + * Create a new local info. * @param slot The slot of this variable. */ public LocalInfo(int slot) { @@ -138,8 +144,8 @@ public class LocalInfo { if (jode.Decompiler.prettyLocals && type != null) { name = type.getDefaultName(); } else { - name = type.getDefaultName() + - "_" + slot + "_" + serialnr++ + "_"; + name = type.getDefaultName() + + (slot >= 0 ? "_" + slot : "") + "_" + serialnr++ + "_"; isUnique = true; } }