- int pdepth=depth+1;
- currCase.append("{\n");
- //Array Case
- if(node.isObjectArray() && node.decendantsConflict()) {
- //since each array element will get its own case statement, we just need to enqueue each item into the queue
- //note that the ref would be the actual object and node would be of struct ArrayObject
-
- ArrayList<Integer> allocSitesWithProblems = node.getReferencedAllocSites();
- if(!allocSitesWithProblems.isEmpty()) {
- String childPtr = "((struct ___Object___ **)(((char *) &(((struct ArrayObject *)"+ prefix+")->___length___))+sizeof(int)))[i]";
- String currPtr = "arrayElement" + pdepth;
-
- //This is done with the assumption that an array of object stores pointers.
- currCase.append("{\n int i;\n");
- currCase.append(" for(i = 0; i<((struct ArrayObject *) " + prefix + " )->___length___; i++ ) {\n");
- currCase.append(" struct ___Object___ *"+currPtr+" = "+childPtr+";\n");
- currCase.append(" if( arrayElement"+pdepth+" != NULL) {\n");
-
- //There should be only one field, hence we only take the first field in the keyset.
- assert node.objectRefs.keySet().size() <= 1;
- ArrayList<ObjRef> refsAtParticularField = node.objectRefs.get(node.objectRefs.keySet().iterator().next());
- printObjRefSwitchStatement(taint,cases,pdepth,currCase,refsAtParticularField,childPtr,currPtr);
- currCase.append(" }}}\n");
- }
- } else {
- //All other cases
- for(String field: node.objectRefs.keySet()) {
- ArrayList<ObjRef> refsAtParticularField = node.objectRefs.get(field);
- String childPtr = "((struct "+node.original.getType().getSafeSymbol()+" *)"+prefix +")->___" + field + "___";
+ //Handle conflicts further down.
+ if(node.decendantsConflict()) {
+ int pdepth=depth+1;
+ currCase.append("{\n");
+ //Array Case
+ if(node.isObjectArray() && node.decendantsConflict()) {
+ ArrayList<Integer> allocSitesWithProblems = node.getReferencedAllocSites();
+ if(!allocSitesWithProblems.isEmpty()) {
+ String childPtr = "((struct ___Object___ **)(((char *) &(((struct ArrayObject *)"+ prefix+")->___length___))+sizeof(int)))[i]";
+ String currPtr = "arrayElement" + pdepth;
+
+ currCase.append("{\n int i;\n");
+ currCase.append(" struct ___Object___ * "+currPtr+";\n");
+ currCase.append(" for(i = 0; i<((struct ArrayObject *) " + prefix + " )->___length___; i++ ) {\n");
+
+ //There should be only one field, hence we only take the first field in the keyset.
+ assert node.objectRefs.keySet().size() <= 1;
+ ObjRefList refsAtParticularField = node.objectRefs.get(node.objectRefs.keySet().iterator().next());
+
+ printObjRefSwitchStatement(taint,cases,pdepth,currCase,refsAtParticularField,childPtr,currPtr);
+ currCase.append(" }}\n");
+ }
+ } else {
+ //All other cases