Skip to content

Corrections on PR 675 #688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/goto-programs/string_refine_preprocess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -809,11 +809,13 @@ void string_refine_preprocesst::make_string_function_side_effect(
const irep_idt &function_name,
const std::string &signature)
{
// Cannot use const & here
code_function_callt function_call=to_code_function_call(target->code);
source_locationt loc=function_call.source_location();
std::list<code_assignt> assignments;
exprt lhs=function_call.lhs();
exprt s=function_call.arguments()[0];
const exprt &lhs=function_call.lhs();
assert(!function_call.arguments().empty());
const exprt &s=function_call.arguments()[0];
code_typet function_type=to_code_type(function_call.type());

function_type.return_type()=s.type();
Expand Down Expand Up @@ -901,7 +903,7 @@ void string_refine_preprocesst::make_to_char_array_function(
const code_function_callt &function_call=to_code_function_call(target->code);
source_locationt location=function_call.source_location();

assert(function_call.arguments().size()>=1);
assert(!function_call.arguments().empty());
const exprt &string_argument=function_call.arguments()[0];
assert(is_java_string_pointer_type(string_argument.type()));

Expand Down Expand Up @@ -985,7 +987,7 @@ exprt::operandst string_refine_preprocesst::process_arguments(
arg=typecast_exprt(arg, jls_ptr);
}
arg=make_cprover_string_assign(goto_program, target, arg, location);
typet type=ns.follow(arg.type());
const typet &type=ns.follow(arg.type());
if(is_java_char_array_pointer_type(type))
{
arg=make_cprover_char_array_assign(goto_program, target, arg, location);
Expand Down
12 changes: 12 additions & 0 deletions src/solvers/refinement/string_constraint_generator_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,18 @@ string_exprt string_constraint_generatort::get_string_expr(const exprt &expr)
}
}

/*******************************************************************\

Function: string_constraint_generatort::convert_java_string_to_string_exprt

Inputs: a java string

Outputs: a string expression

Purpose: create a new string_exprt as a conversion of a java string

\*******************************************************************/

string_exprt string_constraint_generatort::convert_java_string_to_string_exprt(
const exprt &jls)
{
Expand Down
3 changes: 0 additions & 3 deletions src/solvers/refinement/string_refinement.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ class string_refinementt: public bv_refinementt

unsigned initial_loop_bound;

// Is the current model correct
bool concrete_model;

string_constraint_generatort generator;

// Simple constraints that have been given to the solver
Expand Down