Skip to content

Commit 278e4e6

Browse files
authored
Merge pull request #1826 from smowton/smowton/fix/java-inherited-static-fields
Add support for inheritence of Java static fields. Fixes TG-2457
2 parents a2ebb33 + 1da5be1 commit 278e4e6

File tree

96 files changed

+1321
-275
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1321
-275
lines changed
Binary file not shown.
Binary file not shown.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
public class Test extends Parent {
2+
3+
public static void main(int nondet) {
4+
5+
x = nondet;
6+
assert x == Parent.x;
7+
8+
}
9+
10+
}
11+
12+
class Parent {
13+
14+
public static int x;
15+
16+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
Test.class
3+
4+
^VERIFICATION SUCCESSFUL$
5+
--
6+
--
7+
This checks that jbmc knows that test.x and parent.x refer to the same field.
8+
Both test and parent are concrete (available) classes.
Binary file not shown.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
public class Parent {
3+
4+
// This is the version of Parent we will run jbmc against, which has
5+
// a static field 'x', but that field is private and cannot correspond
6+
// to the reference 'Test.x'.
7+
private static int x;
8+
9+
}
Binary file not shown.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
public class Test extends Parent {
2+
3+
public static void main(int nondet) {
4+
5+
x = nondet;
6+
assert x == Parent.x;
7+
8+
}
9+
10+
}
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
public class Parent {
3+
4+
// This is the version of Parent we compile Test.java against, which does
5+
// have a static field 'x'.
6+
public static int x;
7+
8+
}

0 commit comments

Comments
 (0)