Skip to content

Add getter/setter for ID_enumeration in java_class_typet #4572

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jbmc/src/java_bytecode/java_bytecode_convert_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ void java_bytecode_convert_classt::convert(
class_type.set(
ID_java_enum_static_unwind,
std::to_string(c.enum_elements+1));
class_type.set(ID_enumeration, true);
class_type.set_is_enumeration(true);
}

if(c.is_public)
Expand Down
12 changes: 12 additions & 0 deletions jbmc/src/java_bytecode/java_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,18 @@ class java_class_typet:public class_typet
return get_bool(ID_incomplete_class);
}

/// is class an enumeration?
bool get_is_enumeration() const
{
return get_bool(ID_enumeration);
}

/// marks class as an enumeration
void set_is_enumeration(const bool is_enumeration)
{
set(ID_enumeration, is_enumeration);
}

// it may be better to introduce a class like
// class java_lambda_method_handlet : private irept
// {
Expand Down