Skip to content

Commit

Permalink
Add function to retrieve a reference to the element type of a java array
Browse files Browse the repository at this point in the history
  • Loading branch information
majakusber committed Jul 4, 2018
1 parent 6e554d9 commit 9b8cfc2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions jbmc/src/java_bytecode/java_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,17 @@ typet java_array_element_type(const symbol_typet &array_type)
return array_type.find_type(ID_C_element_type);
}

/// Return a const reference to the element type of a given java array type
/// \param array_type The java array type
const typet &java_array_element_type_ref(const symbol_typet &array_type)
{
INVARIANT(
is_java_array_tag(array_type.get_identifier()),
"Symbol should have array tag");
return array_type.find_type(ID_C_element_type);
}


/// See above
/// \par parameters: Struct tag 'tag'
/// \return True if the given struct is a Java array
Expand Down
1 change: 1 addition & 0 deletions jbmc/src/java_bytecode/java_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ symbol_typet java_classname(const std::string &);

reference_typet java_array_type(const char subtype);
typet java_array_element_type(const symbol_typet &array_type);
const typet &java_array_element_type_ref(const symbol_typet &array_type);

bool is_reference_type(char t);

Expand Down

0 comments on commit 9b8cfc2

Please sign in to comment.