Skip to content

Commit df03a01

Browse files
author
Joel Allred
committed
Corrections on PR 675
Remarks by Peter Schrammel
1 parent e4e26d8 commit df03a01

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

src/goto-programs/string_refine_preprocess.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -809,11 +809,14 @@ void string_refine_preprocesst::make_string_function_side_effect(
809809
const irep_idt &function_name,
810810
const std::string &signature)
811811
{
812+
// TODO: Here we create a copy of the code_function_cally. We would prefer
813+
// accessing it by reference, but this creates problems.
812814
code_function_callt function_call=to_code_function_call(target->code);
813815
source_locationt loc=function_call.source_location();
814816
std::list<code_assignt> assignments;
815-
exprt lhs=function_call.lhs();
816-
exprt s=function_call.arguments()[0];
817+
const exprt &lhs=function_call.lhs();
818+
assert(!function_call.arguments().empty());
819+
const exprt &s=function_call.arguments()[0];
817820
code_typet function_type=to_code_type(function_call.type());
818821

819822
function_type.return_type()=s.type();
@@ -901,7 +904,7 @@ void string_refine_preprocesst::make_to_char_array_function(
901904
const code_function_callt &function_call=to_code_function_call(target->code);
902905
source_locationt location=function_call.source_location();
903906

904-
assert(function_call.arguments().size()>=1);
907+
assert(!function_call.arguments().empty());
905908
const exprt &string_argument=function_call.arguments()[0];
906909
assert(is_java_string_pointer_type(string_argument.type()));
907910

@@ -985,7 +988,7 @@ exprt::operandst string_refine_preprocesst::process_arguments(
985988
arg=typecast_exprt(arg, jls_ptr);
986989
}
987990
arg=make_cprover_string_assign(goto_program, target, arg, location);
988-
typet type=ns.follow(arg.type());
991+
const typet &type=ns.follow(arg.type());
989992
if(is_java_char_array_pointer_type(type))
990993
{
991994
arg=make_cprover_char_array_assign(goto_program, target, arg, location);

src/solvers/refinement/string_constraint_generator_main.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,18 @@ string_exprt string_constraint_generatort::get_string_expr(const exprt &expr)
208208
}
209209
}
210210

211+
/*******************************************************************\
212+
213+
Function: string_constraint_generatort::convert_java_string_to_string_exprt
214+
215+
Inputs: a java string
216+
217+
Outputs: a string expression
218+
219+
Purpose: create a new string_exprt as a conversion of a java string
220+
221+
\*******************************************************************/
222+
211223
string_exprt string_constraint_generatort::convert_java_string_to_string_exprt(
212224
const exprt &jls)
213225
{

src/solvers/refinement/string_refinement.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ class string_refinementt: public bv_refinementt
6363

6464
unsigned initial_loop_bound;
6565

66-
// Is the current model correct
67-
bool concrete_model;
68-
6966
string_constraint_generatort generator;
7067

7168
// Simple constraints that have been given to the solver

0 commit comments

Comments
 (0)