Skip to content

Commit 32e5d4f

Browse files
authored
Merge pull request #4660 from diffblue/revert-4643-max-nondet-string-length-default
Revert "Set max-nondet-string-length to 10000 by default"
2 parents 046ed40 + c35c16a commit 32e5d4f

File tree

6 files changed

+8
-23
lines changed

6 files changed

+8
-23
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
CORE
22
Test.class
3-
--function Test.check --max-nondet-string-length 1000000000
3+
--function Test.check
44
^EXIT=10$
55
^SIGNAL=0$
66
^VERIFICATION FAILED$
77
file Test.java line 20 .*: FAILURE$
88
--
99
--
10-
This tests the behaviour of string refinement on very large strings.
11-
max-nondet-string-length is set big enough to cause an overflow.
10+
--max-nondet-string-length is not used on purpose, because this tests the behaviour
11+
of string refinement on very large strings.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
CORE
22
Test.class
3-
--function Test.checkAbort --trace --max-nondet-string-length 1000000000
3+
--function Test.checkAbort --trace
44
^EXIT=10$
55
^SIGNAL=0$
66
dynamic_object[0-9]*=\(assignment removed\)
77
--
88
--
99
This tests that the object does not appear in the trace, because concretizing
1010
a string of the required length may take too much memory.
11-
max-nondet-string-length is set big enough to cause an overflow.
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test.class
3-
--function Test.checkMinLength --string-non-empty --max-nondet-string-length 2000000000
3+
--function Test.checkMinLength --string-non-empty
44
^EXIT=10$
55
^SIGNAL=0$
66
assertion.* line 11 function java::Test.checkMinLength.*: SUCCESS
@@ -9,5 +9,3 @@ assertion.* line 17 function java::Test.checkMinLength.*: FAILURE
99
assertion.* line 19 function java::Test.checkMinLength.*: FAILURE
1010
--
1111
^Building error trace
12-
--
13-
max-nondet-string-length is set big enough to cause an overflow.

src/solvers/strings/string_refinement.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Author: Alberto Griggio, [email protected]
2121
#define CPROVER_SOLVERS_REFINEMENT_STRING_REFINEMENT_H
2222

2323
#include <limits>
24-
#include <util/magic.h>
2524
#include <util/replace_expr.h>
2625
#include <util/string_expr.h>
2726
#include <util/union_find_replace.h>
@@ -46,8 +45,7 @@ Author: Alberto Griggio, [email protected]
4645
" --string-input-value st restrict non-null strings to a fixed value st;\n" /* NOLINT(*) */ \
4746
" the switch can be used multiple times to give\n" /* NOLINT(*) */ \
4847
" several strings\n" /* NOLINT(*) */ \
49-
" --max-nondet-string-length n bound the length of nondet (e.g. input) strings;\n" /* NOLINT(*) */ \
50-
" set to " + std::to_string(MAX_NONDET_STRING_LENGTH_DEFAULT) + " by default\n" /* NOLINT(*) */
48+
" --max-nondet-string-length n bound the length of nondet (e.g. input) strings\n" /* NOLINT(*) */
5149

5250
// The integration of the string solver into CBMC is incomplete. Therefore,
5351
// it is not turned on by default and not all options are available.

src/util/magic.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,4 @@ const std::size_t MAX_CONCRETE_STRING_SIZE = 1 << 26;
1616
// The top end of the range of integers for which dstrings are precomputed
1717
constexpr std::size_t DSTRING_NUMBERS_MAX = 64;
1818

19-
const int MAX_NONDET_STRING_LENGTH_DEFAULT = 10000;
20-
2119
#endif

src/util/object_factory_parameters.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ Author: Diffblue Ltd
88

99
#include "object_factory_parameters.h"
1010

11-
#include "cmdline.h"
12-
#include "magic.h"
13-
#include "options.h"
11+
#include <util/cmdline.h>
12+
#include <util/options.h>
1413

1514
void object_factory_parameterst::set(const optionst &options)
1615
{
@@ -69,19 +68,12 @@ void parse_object_factory_options(const cmdlinet &cmdline, optionst &options)
6968
options.set_option(
7069
"min-null-tree-depth", cmdline.get_value("min-null-tree-depth"));
7170
}
72-
7371
if(cmdline.isset("max-nondet-string-length"))
7472
{
7573
options.set_option(
7674
"max-nondet-string-length",
7775
cmdline.get_value("max-nondet-string-length"));
7876
}
79-
else if(!cmdline.isset("no-refine-strings"))
80-
{
81-
options.set_option(
82-
"max-nondet-string-length", MAX_NONDET_STRING_LENGTH_DEFAULT);
83-
}
84-
8577
if(cmdline.isset("string-printable"))
8678
{
8779
options.set_option("string-printable", true);

0 commit comments

Comments
 (0)