Skip to content

Commit 2c2c5ed

Browse files
Add a test for the string solver
This is an example for which a branch with changes to symex (field-sensitivity) caused failure in the string solver because a nil expression got into the model.
1 parent 9962b7c commit 2c2c5ed

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed
Binary file not shown.

jbmc/regression/jbmc-strings/StringConcat/Test.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,4 +312,15 @@ public String bufferNonDetLoop5(int cols, int columnWidth, String c, String data
312312
assert(false);
313313
return sb.toString();
314314
}
315+
316+
static boolean fromNonDetArray(String[] argv)
317+
{
318+
String s = argv[0];
319+
String u = s.concat("llo");
320+
if(u.equals("Hello")) {
321+
return true;
322+
}
323+
return false;
324+
}
325+
315326
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
Test.class
3+
--function Test.fromNonDetArray --depth 10000 --unwind 5 --throw-runtime-exceptions --cp `../../../../scripts/format_classpath.sh . ../../../lib/java-models-library/target/core-models.jar` --trace
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^VERIFICATION FAILED
7+
line 318 no uncaught exception: FAILURE
8+
java.lang.ArrayIndexOutOfBoundsException|java.lang.NullPointerException

0 commit comments

Comments
 (0)