Skip to content

Commit 4d75d3d

Browse files
author
Daniel Kroening
committed
Merge branch 'develop' of github.com:diffblue/cbmc into develop
2 parents 60c03b3 + 3ea32fe commit 4d75d3d

File tree

5 files changed

+28
-1
lines changed

5 files changed

+28
-1
lines changed
672 Bytes
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
public class Test {
2+
3+
public static boolean test(char c1, char c2, char c3, char c4, char c5, char c6, char c7, char c8) {
4+
StringBuilder sb = new StringBuilder("");
5+
sb.append(c1);
6+
sb.append(c2);
7+
sb.append(c3);
8+
sb.append(c4);
9+
sb.append(c5);
10+
sb.append(c6);
11+
sb.append(c7);
12+
sb.append(c8);
13+
if (sb.toString().equals("\b\t\n\f\r\"\'\\"))
14+
return true;
15+
if (!sb.toString().equals("\b\t\n\f\r\"\'\\"))
16+
return false;
17+
return true;
18+
}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CORE
2+
Test.class
3+
--refine-strings --function Test.test --cover location --trace --json-ui
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
20 of 23 covered \(87.0%\)|30 of 44 covered \(68.2%\)

src/java_bytecode/java_string_library_preprocess.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -902,10 +902,11 @@ void java_string_library_preprocesst::code_assign_java_string_to_string_expr(
902902
// Although we should not reach this code if rhs is null, the association
903903
// `pointer -> length` is added to the solver anyway, so we have to make sure
904904
// the length is set to something reasonable.
905-
const auto rhs_length = if_exprt(
905+
auto rhs_length = if_exprt(
906906
equal_exprt(rhs, null_pointer_exprt(to_pointer_type(rhs.type()))),
907907
from_integer(0, lhs.length().type()),
908908
get_length(deref, symbol_table));
909+
rhs_length.set(ID_mode, ID_java);
909910

910911
// Assignments
911912
code.add(code_assignt(lhs.length(), rhs_length), loc);

src/pointer-analysis/value_set_dereference.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ exprt value_set_dereferencet::dereference(
153153
symbol.name="symex::invalid_object"+std::to_string(invalid_counter++);
154154
symbol.base_name="invalid_object";
155155
symbol.type=type;
156+
symbol.mode = language_mode;
156157

157158
// make it a lvalue, so we can assign to it
158159
symbol.is_lvalue=true;

0 commit comments

Comments
 (0)