Skip to content

[TG-2434] static constructor calling opaque constructor #1911

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 1 commit
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
Prev Previous commit
Next Next commit
Adding wrappers around whether a code_type is a constructor
  • Loading branch information
thk123 committed Mar 9, 2018
commit e8cbf903f843aabefd3bd390b22ea6bac2b5c05b
6 changes: 3 additions & 3 deletions src/java_bytecode/java_bytecode_convert_method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ void java_bytecode_convert_method_lazy(
method_symbol.pretty_name=
id2string(class_symbol.pretty_name)+"."+
id2string(class_symbol.base_name)+"()";
member_type.set(ID_constructor, true);
member_type.set_is_constructor();
}
else
method_symbol.pretty_name=
Expand Down Expand Up @@ -538,7 +538,7 @@ void java_bytecode_convert_methodt::convert(
method_symbol.pretty_name = id2string(class_symbol.pretty_name) + "." +
id2string(class_symbol.base_name) + "()";
INVARIANT(
member_type.get_bool(ID_constructor),
code_type.get_is_constructor(),
"Member type should have already been marked as a constructor");
}
else
Expand Down Expand Up @@ -1271,7 +1271,7 @@ codet java_bytecode_convert_methodt::convert_instructions(
{
if(needed_lazy_methods)
needed_lazy_methods->add_needed_class(classname);
code_type.set(ID_constructor, true);
code_type.set_is_constructor();
}
else
code_type.set(ID_java_super_method_call, true);
Expand Down
10 changes: 10 additions & 0 deletions src/util/std_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,16 @@ class code_typet:public typet
return set(ID_access, access);
}

bool get_is_constructor() const
{
return get_bool(ID_constructor);
}

void set_is_constructor()
{
set(ID_constructor, true);
}

// this produces the list of parameter identifiers
std::vector<irep_idt> parameter_identifiers() const
{
Expand Down