@@ -1300,7 +1300,8 @@ code_blockt java_string_library_preprocesst::make_copy_string_code(
1300
1300
// / object.
1301
1301
// / \param type: type of the function
1302
1302
// / \param loc: location in the source
1303
- // / \param function_id: unused
1303
+ // / \param function_id: name of the function (used for variable naming) where
1304
+ // / the generated code ends up.
1304
1305
// / \param symbol_table: symbol table
1305
1306
// / \return Code corresponding to:
1306
1307
// / ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1314,31 +1315,28 @@ code_blockt java_string_library_preprocesst::make_copy_constructor_code(
1314
1315
const irep_idt &function_id,
1315
1316
symbol_table_baset &symbol_table)
1316
1317
{
1317
- (void )function_id;
1318
-
1319
- // Code for the output
1320
- code_blockt code;
1318
+ code_blockt copy_constructor_body;
1321
1319
1322
1320
// String expression that will hold the result
1323
1321
const refined_string_exprt string_expr =
1324
- decl_string_expr (loc, function_id, symbol_table, code );
1322
+ decl_string_expr (loc, function_id, symbol_table, copy_constructor_body );
1325
1323
1326
1324
// Assign argument to a string_expr
1327
1325
const java_method_typet::parameterst ¶ms = type.parameters ();
1328
1326
PRECONDITION (!params[0 ].get_identifier ().empty ());
1329
1327
PRECONDITION (!params[1 ].get_identifier ().empty ());
1330
1328
const symbol_exprt arg1{params[1 ].get_identifier (), params[1 ].type ()};
1331
1329
code_assign_java_string_to_string_expr (
1332
- string_expr, arg1, loc, symbol_table, code );
1330
+ string_expr, arg1, loc, symbol_table, copy_constructor_body );
1333
1331
1334
1332
// Assign string_expr to `this` object
1335
1333
const symbol_exprt arg_this{params[0 ].get_identifier (), params[0 ].type ()};
1336
- code .add (
1334
+ copy_constructor_body .add (
1337
1335
code_assign_string_expr_to_java_string (
1338
1336
arg_this, string_expr, symbol_table, true ),
1339
1337
loc);
1340
1338
1341
- return code ;
1339
+ return copy_constructor_body ;
1342
1340
}
1343
1341
1344
1342
// / Generates code for the String.length method
0 commit comments