Skip to content

Commit 9064aeb

Browse files
committed
Fix stub string lengths
The --max-nondet-string-length parameter accidentally stopped applying to them when its name was changed.
1 parent ec79bdd commit 9064aeb

File tree

5 files changed

+26
-2
lines changed

5 files changed

+26
-2
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

+2-2
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,8 @@ 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"))
502+
cmdline.isset("max-nondet-string-length")
503+
? std::stoul(cmdline.get_value("max-nondet-string-length"))
504504
: MAX_NONDET_STRING_LENGTH;
505505
object_factory_params.max_nondet_tree_depth =
506506
cmdline.isset("java-max-input-tree-depth")

0 commit comments

Comments
 (0)