Skip to content

The analysis state is not updating correctly #37

@giacomozanatta

Description

@giacomozanatta
public class B {
    int i;
    int x;
    C c;
    public B() {
        C c1 = new C();
        this.c = c1;
        this.i = 10;
    }

    public B(int x) {
        this();
        C c1 = new C(x);
        this.c = c1;
        this.x = x;
    }
}

public class C {
    int a;
    public C() {
        this(1000);
    }

    public C(int a) {
        this.a = a;
    }
}

public class Main {
    public static void main(String[] args) {
        B b1 = new B(8);
        B b3 = new B(9);
        //B b2 = new B(100);
        //C c1 = new C();
        //C c3 = new C();
        //C c2 = new C(88);
        //int a = b1.c.a;
    }
}

Analysis Result:

Image

We expect that heap[w]:pp@'B.java':6:15[a]: [8, 9]

Metadata

Metadata

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions