File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,11 @@ pointer_typet select_pointer_typet::specialize_generics(
94
94
{
95
95
return result.value ();
96
96
}
97
- throw " no infinite recursion" ;
97
+ else
98
+ {
99
+ // return pointer type of generic parameter bound
100
+ return java_reference_type (parameter.subtype ());
101
+ }
98
102
}
99
103
100
104
// generic parameters can be adopted from outer classes or superclasses so
@@ -204,9 +208,8 @@ optionalt<pointer_typet> select_pointer_typet::get_instantiated_type(
204
208
const auto &replacements =
205
209
generic_parameter_specialization_map.find (parameter_name)->second ;
206
210
207
- // max depth reached and nothing found, TODO return bound
208
- if (replacements.size () <= depth)
209
- return {};
211
+ INVARIANT (
212
+ depth < replacements.size (), " cannot access elements outside stack" );
210
213
211
214
// Check if there is a recursion loop, if yes return with nothing found
212
215
if (visited.find (parameter_name) != visited.end ())
You can’t perform that action at this time.
0 commit comments