File tree Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -120,15 +120,24 @@ reference_typet java_array_type(const char subtype)
120120 return java_reference_type (symbol_type);
121121}
122122
123- // / Return the type of the elements of a given java array type
124- // / \param array_type The java array type
125- // / \return The type of the elements of the array
126- typet java_array_element_type (const symbol_typet &array_type)
123+ // / Return a const reference to the element type of a given java array type
124+ // / \param array_symbol The java array type
125+ const typet &java_array_element_type (const symbol_typet &array_symbol)
127126{
128127 INVARIANT (
129- is_java_array_tag (array_type .get_identifier ()),
128+ is_java_array_tag (array_symbol .get_identifier ()),
130129 " Symbol should have array tag" );
131- return array_type.find_type (ID_C_element_type);
130+ return array_symbol.find_type (ID_C_element_type);
131+ }
132+
133+ // / Return a non-const reference to the element type of a given java array type
134+ // / \param array_symbol The java array type
135+ typet &java_array_element_type (symbol_typet &array_symbol)
136+ {
137+ INVARIANT (
138+ is_java_array_tag (array_symbol.get_identifier ()),
139+ " Symbol should have array tag" );
140+ return const_cast <typet &>(array_symbol.find_type (ID_C_element_type));
132141}
133142
134143// / See above
Original file line number Diff line number Diff line change @@ -235,7 +235,8 @@ reference_typet java_lang_object_type();
235235symbol_typet java_classname (const std::string &);
236236
237237reference_typet java_array_type (const char subtype);
238- typet java_array_element_type (const symbol_typet &array_type);
238+ const typet &java_array_element_type (const symbol_typet &array_symbol);
239+ typet &java_array_element_type (symbol_typet &array_symbol);
239240
240241bool is_reference_type (char t);
241242
You can’t perform that action at this time.
0 commit comments