Skip to content

Commit f4f01cd

Browse files
committed
Test the this argument used when checking a constructor
To ensure the fields of the `this` argument to the a constructor are not incorrectly nondet initialised before entering the constructor.
1 parent cfeade5 commit f4f01cd

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed
577 Bytes
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class Constructor2 {
2+
int myField;
3+
4+
Constructor2() { assert myField == 0; }
5+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CORE
2+
Constructor2.class
3+
--function 'Constructor2.<init>'
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
^warning: ignoring
9+
--
10+
Test that a field of a class being constructed is zero initialised before the
11+
constructor is called, where the function being checked is a constructor.

0 commit comments

Comments
 (0)