File tree Expand file tree Collapse file tree 5 files changed +39
-0
lines changed
jbmc/regression/jbmc/symex_should_resolve_class_identifiers Expand file tree Collapse file tree 5 files changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ public class Test {
2
+
3
+ public static class A {
4
+ public int getInteger () {
5
+ return 0 ;
6
+ }
7
+ }
8
+
9
+ public static class B extends A {
10
+ public int getInteger () {
11
+ return 1 ;
12
+ }
13
+ }
14
+
15
+ public static void test (A a ) {
16
+ // Need to instantiate B to make sure it's loaded
17
+ B dummyB = new B ();
18
+
19
+ int zero = a .getInteger ();
20
+ assert (zero == 2 );
21
+ }
22
+
23
+ }
Original file line number Diff line number Diff line change
1
+ CORE
2
+ Test.class
3
+ --function Test.test --show-vcc
4
+ ^EXIT=0$
5
+ ^SIGNAL=0$
6
+ --
7
+ java::Test\$B\.getInteger
8
+ ^warning: ignoring
9
+ --
10
+ Symex should have the values of all class_identifier fields in its constant
11
+ propagation map, so that it can run efficiently and create a simpler equation.
12
+ If an argument to the entrypoint is nondet-initialised using automatic local
13
+ initialisation then symex thinks its class identifier might be uninitialised,
14
+ and hence could be anything, because that's what happens in the null case (but
15
+ we never access the class identifier in this case). Hence we have switched to
16
+ dynamic allocation for this situation.
You can’t perform that action at this time.
0 commit comments