Skip to content

Commit 0c265e9

Browse files
author
svorenova
committed
Use can_cast_type instead of raw type id check
1 parent ad054ab commit 0c265e9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

jbmc/src/java_bytecode/java_types.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ typet &java_array_element_type(symbol_typet &array_symbol)
148148
/// Checks whether the given type is an array pointer type
149149
bool is_java_array_type(const typet &type)
150150
{
151-
if(!(type.id() == ID_pointer && type.subtype().id() == ID_symbol))
151+
if(
152+
can_cast_type<pointer_typet>(type) &&
153+
can_cast_type<symbol_typet>(type.subtype()))
152154
return false;
153155
const auto &subtype_symbol = to_symbol_type(type.subtype());
154156
return is_java_array_tag(subtype_symbol.get_identifier());

0 commit comments

Comments
 (0)