Skip to content

Commit 512d79f

Browse files
Add function_name argument to decl_string_expr
This is in preparation for giving function_name as an argument to the function creating new string objects.
1 parent 2652368 commit 512d79f

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

jbmc/src/java_bytecode/java_string_library_preprocess.cpp

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,11 @@ java_string_library_preprocesst::convert_exprt_to_string_exprt(
305305
{
306306
PRECONDITION(implements_java_char_sequence_pointer(expr_to_process.type()));
307307
const refined_string_exprt string_expr =
308-
decl_string_expr(loc, symbol_table, init_code);
308+
decl_string_expr(
309+
loc,
310+
loc.get_function(),
311+
symbol_table,
312+
init_code);
309313
code_assign_java_string_to_string_expr(
310314
string_expr, expr_to_process, loc, symbol_table, init_code);
311315
return string_expr;
@@ -497,6 +501,7 @@ symbol_exprt java_string_library_preprocesst::fresh_string(
497501
/// \return refined string expr with fresh content and length symbols
498502
refined_string_exprt java_string_library_preprocesst::decl_string_expr(
499503
const source_locationt &loc,
504+
const irep_idt &function_name,
500505
symbol_table_baset &symbol_table,
501506
code_blockt &code)
502507
{
@@ -538,7 +543,11 @@ refined_string_exprt java_string_library_preprocesst::make_nondet_string_expr(
538543
code_blockt &code)
539544
{
540545
/// \todo refactor with initialize_nonddet_string_struct
541-
const refined_string_exprt str = decl_string_expr(loc, symbol_table, code);
546+
const refined_string_exprt str = decl_string_expr(
547+
loc,
548+
loc.get_function(),
549+
symbol_table,
550+
code);
542551

543552
const side_effect_expr_nondett nondet_length(str.length().type(), loc);
544553
code.add(code_assignt(str.length(), nondet_length), loc);
@@ -1648,7 +1657,11 @@ codet java_string_library_preprocesst::make_copy_string_code(
16481657

16491658
// String expression that will hold the result
16501659
const refined_string_exprt string_expr =
1651-
decl_string_expr(loc, symbol_table, code);
1660+
decl_string_expr(
1661+
loc,
1662+
loc.get_function(),
1663+
symbol_table,
1664+
code);
16521665

16531666
// Assign the argument to string_expr
16541667
const java_method_typet::parametert op = type.parameters()[0];
@@ -1693,7 +1706,7 @@ codet java_string_library_preprocesst::make_copy_constructor_code(
16931706

16941707
// String expression that will hold the result
16951708
const refined_string_exprt string_expr =
1696-
decl_string_expr(loc, symbol_table, code);
1709+
decl_string_expr(loc, function_id, symbol_table, code);
16971710

16981711
// Assign argument to a string_expr
16991712
const java_method_typet::parameterst params = type.parameters();

jbmc/src/java_bytecode/java_string_library_preprocess.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ class java_string_library_preprocesst:public messaget
232232

233233
refined_string_exprt decl_string_expr(
234234
const source_locationt &loc,
235+
const irep_idt &function_name,
235236
symbol_table_baset &symbol_table,
236237
code_blockt &code);
237238

0 commit comments

Comments
 (0)