Skip to content

Commit 57988fc

Browse files
committed
Fix String type initialisation when --refine-strings is not active
Previously this would incorrectly leave a branch on which the object was not initialised at all. Now it is always initialised, falling back to conventional initialisation when string-specific init is not possible.
1 parent c817486 commit 57988fc

File tree

13 files changed

+91
-12
lines changed

13 files changed

+91
-12
lines changed
Binary file not shown.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import org.cprover.CProver;
2+
3+
class NondetCharSequence
4+
{
5+
static void main()
6+
{
7+
CharSequence x = CProver.nondetWithNull();
8+
assert x == null || x instanceof CharSequence;
9+
}
10+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
NondetCharSequence.class
3+
4+
^VERIFICATION SUCCESSFUL$
5+
^EXIT=0$
6+
^SIGNAL=0$
7+
--
8+
^warning: ignoring
Binary file not shown.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import org.cprover.CProver;
2+
3+
class NondetString
4+
{
5+
static void main()
6+
{
7+
String x = CProver.nondetWithNull();
8+
assert x == null || x instanceof String;
9+
}
10+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
NondetString.class
3+
4+
^VERIFICATION SUCCESSFUL$
5+
^EXIT=0$
6+
^SIGNAL=0$
7+
--
8+
^warning: ignoring
Binary file not shown.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import org.cprover.CProver;
2+
3+
class NondetStringBuffer
4+
{
5+
static void main()
6+
{
7+
StringBuffer x = CProver.nondetWithNull();
8+
assert x == null || x instanceof StringBuffer;
9+
}
10+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
NondetStringBuffer.class
3+
4+
^VERIFICATION SUCCESSFUL$
5+
^EXIT=0$
6+
^SIGNAL=0$
7+
--
8+
^warning: ignoring
Binary file not shown.

0 commit comments

Comments
 (0)