From 170c7498faa18869b9c9f26ff18ed40ead78b86c Mon Sep 17 00:00:00 2001 From: spikeuci Date: Fri, 28 Oct 2011 21:03:13 +0000 Subject: [PATCH] Bug fixed --- Robust/src/IR/Tree/BuildIR.java | 2 +- Robust/src/IR/Tree/SemanticCheck.java | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Robust/src/IR/Tree/BuildIR.java b/Robust/src/IR/Tree/BuildIR.java index bfeb388f..4f4a4ee5 100644 --- a/Robust/src/IR/Tree/BuildIR.java +++ b/Robust/src/IR/Tree/BuildIR.java @@ -685,7 +685,7 @@ private void addOuterClassReferences( ClassDescriptor cn, int depth ) SymbolTable fieldTable = icd.getFieldTable(); //System.out.println( fieldTable.toString() ); }*/ - icd.setInnerDepth( depth ); + icd.setInnerDepth( depth + 1 ); addOuterClassReferences( icd, depth + 1 ); } } diff --git a/Robust/src/IR/Tree/SemanticCheck.java b/Robust/src/IR/Tree/SemanticCheck.java index 84645e8e..dddee633 100644 --- a/Robust/src/IR/Tree/SemanticCheck.java +++ b/Robust/src/IR/Tree/SemanticCheck.java @@ -784,7 +784,7 @@ public class SemanticCheck { return null; ClassDescriptor cd = fd.getClassDescriptor(); - int depth = 0; + int depth = 1; int startingDepth = icd.getInnerDepth(); if( true == cd.isInnerClass() ) @@ -793,11 +793,12 @@ public class SemanticCheck { String composed = "this"; NameDescriptor runningDesc = new NameDescriptor( "this" );; - for ( int index = startingDepth; index >= depth; --index ) { - composed = "this$" + String.valueOf( index ); + for ( int index = startingDepth; index > depth; --index ) { + composed = "this$" + String.valueOf( index - 1 ); runningDesc = new NameDescriptor( runningDesc, composed ); } - + if( false == cd.isInnerClass() ) + runningDesc = new NameDescriptor( runningDesc, "this$" + String.valueOf(0) ); //all the way up. NameDescriptor idDesc = new NameDescriptor( runningDesc, varname ); -- 2.34.1