lhs = ffn.getDst();
rhs = ffn.getSrc();
fld = ffn.getField();
- if( !fld.getType().isImmutable() ) {
+ if( !fld.getType().isImmutable() || fld.getType().isArray() ) {
og.assignTempXEqualToTempYFieldF(lhs, rhs, fld);
}
break;
lhs = fsfn.getDst();
fld = fsfn.getField();
rhs = fsfn.getSrc();
- if( !fld.getType().isImmutable() ) {
+ if( !fld.getType().isImmutable() || fld.getType().isArray() ) {
og.assignTempXFieldFEqualToTempY(lhs, fld, rhs);
}
break;
FlatElementNode fen = (FlatElementNode) fn;
lhs = fen.getDst();
rhs = fen.getSrc();
- if( !lhs.getType().isImmutable() ) {
+ if( !lhs.getType().isImmutable() || lhs.getType().isArray() ) {
og.assignTempXEqualToTempYFieldF(lhs, rhs, fdElement);
}
break;
FlatSetElementNode fsen = (FlatSetElementNode) fn;
lhs = fsen.getDst();
rhs = fsen.getSrc();
- if( !rhs.getType().isImmutable() ) {
+ if( !rhs.getType().isImmutable() || rhs.getType().isArray() ) {
og.assignTempXFieldFEqualToTempY(lhs, fdElement, rhs);
}
break;
case FKind.FlatNew:
FlatNew fnn = (FlatNew) fn;
lhs = fnn.getDst();
- if( !lhs.getType().isImmutable() ) {
+ if( !lhs.getType().isImmutable() || lhs.getType().isArray() ) {
AllocationSite as = getAllocationSiteFromFlatNewPRIVATE(fnn);
og.assignTempEqualToNewAlloc(lhs, as);
}
--- /dev/null
+PROGRAM=test
+
+SOURCE_FILES=$(PROGRAM).java
+
+BUILDSCRIPT=~/research/Robust/src/buildscript
+BSFLAGS= -justanalyze -ownership -ownallocdepth 1 -ownwritedots final -enable-assertions
+
+all: $(PROGRAM).bin
+
+view: PNGs
+ eog *.png &
+
+PNGs: DOTs
+ d2p *COMPLETE*.dot
+
+DOTs: $(PROGRAM).bin
+
+$(PROGRAM).bin: $(SOURCE_FILES)
+ $(BUILDSCRIPT) $(BSFLAGS) -o $(PROGRAM) $(SOURCE_FILES)
+
+clean:
+ rm -f $(PROGRAM).bin
+ rm -fr tmpbuilddirectory
+ rm -f *~
+ rm -f *.dot
+ rm -f *.png
+ rm -f aliases.txt
--- /dev/null
+//
+// We should see b and c aliased
+//
+// Also, a and f aliased, and e references a sub region from there
+//
+
+public class TestArrays {
+
+ static public void main( String[] args ) {
+
+ int[] b = new int[10];
+ int[] c = b;
+
+ int[][] a = new int[40][30];
+
+ int d = a[2][1];
+ int[] e = a[1];
+ int[][] f = a;
+
+ int [][] g = disjoint l1 new int[10][];
+ int [][] h = disjoint l2 new int[10][];
+ g[0] = h[0] = new int[5];
+ }
+}