From 96ea5a1115966da168436daa441a64c98e508894 Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 15 Mar 1999 17:56:13 +0000 Subject: [PATCH] merge variables with overlapping addr, same name and same type git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@422 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/decompiler/LocalVariableRangeList.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/jode/jode/decompiler/LocalVariableRangeList.java b/jode/jode/decompiler/LocalVariableRangeList.java index c692b31..c863c1a 100644 --- a/jode/jode/decompiler/LocalVariableRangeList.java +++ b/jode/jode/decompiler/LocalVariableRangeList.java @@ -52,8 +52,21 @@ public class LocalVariableRangeList { before = after; after = after.next; } - if (after != null && li.start + li.length > after.start) + if (after != null && li.start + li.length > after.start) { + if (after.getType().equals(li.getType()) + && after.getName().equals(li.getName())) { + /* Same type, same name and overlapping range. + * This is the same local: extend after to the common + * range and don't add li. + */ + after.length += after.start - li.start; + after.start = li.start; + if (li.length > after.length) + after.length = li.length; + return; + } Decompiler.err.println("warning: non disjoint locals"); + } li.next = after; if (before == null) list = li;