File tree 2 files changed +18
-8
lines changed
2 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -120,15 +120,24 @@ reference_typet java_array_type(const char subtype)
120
120
return java_reference_type (symbol_type);
121
121
}
122
122
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)
127
126
{
128
- INVARIANT (
129
- is_java_array_tag (array_type.get_identifier ()),
127
+ DATA_INVARIANT (
128
+ is_java_array_tag (array_symbol.get_identifier ()),
129
+ " Symbol should have array tag" );
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
+ DATA_INVARIANT (
138
+ is_java_array_tag (array_symbol.get_identifier ()),
130
139
" Symbol should have array tag" );
131
- return array_type. find_type (ID_C_element_type);
140
+ return array_symbol. add_type (ID_C_element_type);
132
141
}
133
142
134
143
// / See above
Original file line number Diff line number Diff line change @@ -245,7 +245,8 @@ reference_typet java_lang_object_type();
245
245
symbol_typet java_classname (const std::string &);
246
246
247
247
reference_typet java_array_type (const char subtype);
248
- typet java_array_element_type (const symbol_typet &array_type);
248
+ const typet &java_array_element_type (const symbol_typet &array_symbol);
249
+ typet &java_array_element_type (symbol_typet &array_symbol);
249
250
250
251
bool is_reference_type (char t);
251
252
You can’t perform that action at this time.
0 commit comments