Skip to content

Commit f6c34f2

Browse files
authored
Merge pull request diffblue#2603 from smowton/smowton/fix/stub-string-lengths
Fix stub string lengths
2 parents 05bebb7 + c98688b commit f6c34f2

File tree

5 files changed

+29
-3
lines changed

5 files changed

+29
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
public class Opaque {
3+
4+
public static String getstr() { return null; }
5+
6+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
public class Test {
3+
4+
public static void main() {
5+
6+
String s = Opaque.getstr();
7+
if(s != null)
8+
assert s.length() <= 10;
9+
10+
}
11+
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CORE
2+
Test.class
3+
--function Test.main --max-nondet-string-length 10
4+
VERIFICATION SUCCESSFUL
5+
EXIT=0
6+
SIGNAL=0

jbmc/src/jbmc/jbmc_parse_options.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -499,9 +499,11 @@ int jbmc_parse_optionst::doit()
499499
? std::stoul(cmdline.get_value("java-max-input-array-length"))
500500
: MAX_NONDET_ARRAY_LENGTH_DEFAULT;
501501
object_factory_params.max_nondet_string_length =
502-
cmdline.isset("string-max-input-length")
503-
? std::stoul(cmdline.get_value("string-max-input-length"))
504-
: MAX_NONDET_STRING_LENGTH;
502+
cmdline.isset("max-nondet-string-length")
503+
? std::stoul(cmdline.get_value("max-nondet-string-length"))
504+
: cmdline.isset("string-max-input-length") // obsolete; will go away
505+
? std::stoul(cmdline.get_value("string-max-input-length"))
506+
: MAX_NONDET_STRING_LENGTH;
505507
object_factory_params.max_nondet_tree_depth =
506508
cmdline.isset("java-max-input-tree-depth")
507509
? std::stoul(cmdline.get_value("java-max-input-tree-depth"))

0 commit comments

Comments
 (0)