Bug fixed
authorspikeuci <spikeuci>
Fri, 28 Oct 2011 21:03:13 +0000 (21:03 +0000)
committerspikeuci <spikeuci>
Fri, 28 Oct 2011 21:03:13 +0000 (21:03 +0000)
Robust/src/IR/Tree/BuildIR.java
Robust/src/IR/Tree/SemanticCheck.java

index bfeb388f7a2867cd54c397b4a297f7e51264eef9..4f4a4ee5b95081913a365d17513ae1af56a243ad 100644 (file)
@@ -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 );      
        }
 }
index 84645e8e631a45948298508a56bc785b7bba627f..dddee6338422be0279b164a0e271da88fbe95ed3 100644 (file)
@@ -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 );