bug fix: The result of the pointer analysis is broken when it tries to do something...
[IRC.git] / Robust / src / Analysis / Pointer / Pointer.java
index d5454e64d84276bdd026020a4342d30c77c99cf4..184cf6511cd3c9b93228fd1f51175512e4c70b70 100644 (file)
@@ -76,7 +76,7 @@ public class Pointer implements HeapAnalysis {
   public BasicBlock getBBlock(FlatMethod fm) {
     if (!blockMap.containsKey(fm)) {
       blockMap.put(fm, BasicBlock.getBBlock(fm));
-      Hashtable<FlatNode, Set<TempDescriptor>> livemap=Liveness.computeLiveTemps(fm);
+      Hashtable<FlatNode, Set<TempDescriptor>> livemap=Liveness.computeLiveTemps(fm,-1);
       for(BBlock bblock : blockMap.get(fm).getBlocks()) {
         FlatNode fn=bblock.nodes.get(0);
         if (fn==fm) {
@@ -216,10 +216,14 @@ nextdelta:
 
     State.logEvent("Done With Pointer Analysis");
 
-
     if (OoOJava) {
       effectsAnalysis.buildStateMachines.writeStateMachines();
       State.logEvent("Done Writing State Machines");
+
+      if( state.OOODEBUG ) {
+        effectsAnalysis.writeEffects("effects.txt");
+        State.logEvent("Done Writing Effects");
+      }
     }
   }
 
@@ -464,9 +468,22 @@ nextdelta:
 
     case FKind.FlatCall:
       return processFlatCall(bblock, index, (FlatCall) node, delta, newgraph);
-
+    
+     /* yonghun - 
+      * Pointer Analysis does not care about a flat literal node, just ignores it.
+      * Right now(2011/05/01) we do not attempt to model a flat literal node 
+      * for checking runtime pointers. 
+    case FKind.FlatLiteralNode:
+      // jjenista - the heap analysis abstraction---when used to verify points-to
+      // analysis results against runtime pointers---will eventually need this to
+      // model that a flat literal node can result in a pointer to an implicitly
+      // allocated string.  For now it will pass through like Pointer used to, but
+      // the checks versus runtime pointers will fail for string literals.
+      return delta;
+     */
+      
     default:
-      throw new Error("Unrecognized node:"+node);
+      throw new Error("Unrecognized node:"+node + " of kind " + node.kind());
     }
   }
 
@@ -2088,4 +2105,55 @@ nextdelta:
       }
     }
   }
-}
\ No newline at end of file
+
+
+
+
+  public Alloc getCmdLineArgsAlloc() {
+    return null;
+  }
+  public Alloc getCmdLineArgAlloc() {
+    return null;
+  }
+  public Alloc getCmdLineArgBytesAlloc() {
+    return null;
+  }
+  public Alloc getNewStringLiteralAlloc() {
+    return null;
+  }
+  public Alloc getNewStringLiteralBytesAlloc() {
+    return null;
+  }
+
+  public Set<Alloc> canPointToAt( TempDescriptor x,
+                                  FlatNode programPoint ) {
+    return null; 
+  }
+
+  public Hashtable< Alloc, Set<Alloc> > canPointToAt( TempDescriptor x,
+                                                      FieldDescriptor f,
+                                                      FlatNode programPoint ) {
+    return null; 
+  }
+
+  public Hashtable< Alloc, Set<Alloc> > canPointToAtElement( TempDescriptor x,
+                                                             FlatNode programPoint ) {
+    return null; 
+  }
+
+  public Set<Alloc> canPointToAfter( TempDescriptor x,
+                                     FlatNode programPoint ) {
+    return null; 
+  }
+
+  public Hashtable< Alloc, Set<Alloc> > canPointToAfter( TempDescriptor x,
+                                                         FieldDescriptor f,
+                                                         FlatNode programPoint ) {
+    return null;
+  }
+
+  public Hashtable< Alloc, Set<Alloc> > canPointToAfterElement( TempDescriptor x, // x[i]
+                                                                FlatNode programPoint ) {
+    return null;
+  }
+}