@@ -535,6 +535,7 @@ refined_string_exprt java_string_library_preprocesst::decl_string_expr(
535
535
// / add symbols with prefix cprover_string_length and cprover_string_data and
536
536
// / construct a string_expr from them.
537
537
// / \param loc: a location in the program
538
+ // / \param function_id: name of the function containing the string
538
539
// / \param symbol_table: symbol table
539
540
// / \param code: code block to which allocation instruction will be added
540
541
// / \return a new string_expr
@@ -648,6 +649,7 @@ codet java_string_library_preprocesst::code_return_function_application(
648
649
// / Declare a fresh symbol of type array of character with infinite size.
649
650
// / \param symbol_table: the symbol table
650
651
// / \param loc: source location
652
+ // / \param function_id: name of the function containing the array
651
653
// / \param code [out] : code block where the declaration gets added
652
654
// / \return created symbol expression
653
655
exprt make_nondet_infinite_char_array (
@@ -660,7 +662,7 @@ exprt make_nondet_infinite_char_array(
660
662
java_char_type (), infinity_exprt (java_int_type ()));
661
663
const symbolt data_sym = get_fresh_aux_symbol (
662
664
array_type,
663
- " nondet_infinite_array " ,
665
+ function_id ,
664
666
" nondet_infinite_array" ,
665
667
loc,
666
668
ID_java,
@@ -941,6 +943,7 @@ java_string_library_preprocesst::string_literal_to_string_expr(
941
943
// / \param type: type of the function call
942
944
// / \param loc: location in the program_invocation_name
943
945
// / \param symbol_table: symbol table
946
+ // / \param function_id: unused
944
947
// / \return Code corresponding to:
945
948
// / ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
946
949
// / IF arg->@class_identifier == "java.lang.String"
@@ -981,7 +984,7 @@ codet java_string_library_preprocesst::make_equals_function_code(
981
984
code_blockt instance_case;
982
985
// Check content equality
983
986
const symbolt string_equals_sym = get_fresh_aux_symbol (
984
- return_type, " string_equals " , " str_eq" , loc, ID_java, symbol_table);
987
+ return_type, function_id , " str_eq" , loc, ID_java, symbol_table);
985
988
const symbol_exprt string_equals = string_equals_sym.symbol_expr ();
986
989
instance_case.add (code_declt (string_equals), loc);
987
990
const exprt::operandst args =
@@ -1736,6 +1739,7 @@ codet java_string_library_preprocesst::make_copy_string_code(
1736
1739
// / object.
1737
1740
// / \param type: type of the function
1738
1741
// / \param loc: location in the source
1742
+ // / \param function_id: unused
1739
1743
// / \param symbol_table: symbol table
1740
1744
// / \return Code corresponding to:
1741
1745
// / ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1749,6 +1753,8 @@ codet java_string_library_preprocesst::make_copy_constructor_code(
1749
1753
const irep_idt &function_id,
1750
1754
symbol_table_baset &symbol_table)
1751
1755
{
1756
+ (void )function_id;
1757
+
1752
1758
// Code for the output
1753
1759
code_blockt code;
1754
1760
@@ -1775,6 +1781,7 @@ codet java_string_library_preprocesst::make_copy_constructor_code(
1775
1781
// / count instead of end index
1776
1782
// / \param type: type of the function call
1777
1783
// / \param loc: location in the program_invocation_name
1784
+ // / \param function_id: unused
1778
1785
// / \param symbol_table: symbol table
1779
1786
// / \return code implementing String intitialization from a char array and
1780
1787
// / arguments offset and end.
@@ -1784,6 +1791,8 @@ codet java_string_library_preprocesst::make_init_from_array_code(
1784
1791
const irep_idt &function_id,
1785
1792
symbol_table_baset &symbol_table)
1786
1793
{
1794
+ (void )function_id;
1795
+
1787
1796
// Code for the output
1788
1797
code_blockt code;
1789
1798
@@ -1819,6 +1828,7 @@ codet java_string_library_preprocesst::make_init_from_array_code(
1819
1828
// / Generates code for the String.length method
1820
1829
// / \param type: type of the function
1821
1830
// / \param loc: location in the source
1831
+ // / \param function_id: unused
1822
1832
// / \param symbol_table: symbol table
1823
1833
// / \return Code corresponding to:
1824
1834
// / ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1832,11 +1842,17 @@ codet java_string_library_preprocesst::make_string_length_code(
1832
1842
const irep_idt &function_id,
1833
1843
symbol_table_baset &symbol_table)
1834
1844
{
1845
+ (void )function_id;
1846
+
1835
1847
code_typet::parameterst params=type.parameters ();
1836
1848
symbol_exprt arg_this (params[0 ].get_identifier (), params[0 ].type ());
1837
1849
dereference_exprt deref=
1838
1850
checked_dereference (arg_this, arg_this.type ().subtype ());
1839
- return code_returnt (get_length (deref, symbol_table));
1851
+
1852
+ code_returnt ret (get_length (deref, symbol_table));
1853
+ ret.add_source_location (loc);
1854
+
1855
+ return ret;
1840
1856
}
1841
1857
1842
1858
bool java_string_library_preprocesst::implements_function (
0 commit comments