Skip to content

Commit c572866

Browse files
author
svorenova
committed
Use can_cast_type instead of raw type id check
1 parent a1ab7a6 commit c572866

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

jbmc/src/java_bytecode/java_types.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,12 @@ typet &java_array_element_type(symbol_typet &array_symbol)
147147
/// Checks whether the given type is an array pointer type
148148
bool is_java_array_type(const typet &type)
149149
{
150-
if(!(type.id() == ID_pointer && type.subtype().id() == ID_symbol))
150+
if(
151+
!can_cast_type<pointer_typet>(type) ||
152+
!can_cast_type<symbol_typet>(type.subtype()))
153+
{
151154
return false;
155+
}
152156
const auto &subtype_symbol = to_symbol_type(type.subtype());
153157
return is_java_array_tag(subtype_symbol.get_identifier());
154158
}

0 commit comments

Comments
 (0)