@@ -345,33 +345,14 @@ bool has_subtype(
345
345
}
346
346
347
347
// / \param type: a type
348
- // / \param ns: namespace
349
348
// / \return true if a subtype of `type` is an pointer of characters.
350
349
// / The meaning of "subtype" is in the algebraic datatype sense:
351
350
// / for example, the subtypes of a struct are the types of its
352
351
// / components, the subtype of a pointer is the type it points to,
353
352
// / etc...
354
- static bool has_char_pointer_subtype (const typet &type, const namespacet &ns )
353
+ static bool has_char_pointer_subtype (const typet &type)
355
354
{
356
- if (is_char_pointer_type (type))
357
- return true ;
358
-
359
- if (type.id () == ID_struct || type.id () == ID_union)
360
- {
361
- const struct_union_typet &struct_type = to_struct_union_type (type);
362
- for (const auto &comp : struct_type.components ())
363
- {
364
- if (has_char_pointer_subtype (comp.type (), ns))
365
- return true ;
366
- }
367
- }
368
-
369
- for (const auto &t : type.subtypes ())
370
- {
371
- if (has_char_pointer_subtype (t, ns))
372
- return true ;
373
- }
374
- return false ;
355
+ return has_subtype (type, is_char_pointer_type);
375
356
}
376
357
377
358
// / \param type: a type
@@ -471,7 +452,7 @@ static union_find_replacet generate_symbol_resolution_from_equations(
471
452
// function applications can be ignored because they will be replaced
472
453
// in the convert_function_application step of dec_solve
473
454
}
474
- else if (has_char_pointer_subtype (lhs.type (), ns ))
455
+ else if (has_char_pointer_subtype (lhs.type ()))
475
456
{
476
457
if (rhs.type ().id () == ID_struct)
477
458
{
0 commit comments