Skip to content

Commit

Permalink
Read the bride flag for methods
Browse files Browse the repository at this point in the history
This is used for compiler generated methods to deal with type erasure.
  • Loading branch information
thk123 authored and jeannielynnmoulton committed Jul 17, 2018
1 parent a18b32d commit efadba2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
3 changes: 3 additions & 0 deletions jbmc/src/java_bytecode/java_bytecode_convert_method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,9 @@ void java_bytecode_convert_method_lazy(
if(m.is_static)
member_type.set(ID_is_static, true);

if(m.is_bridge)
member_type.set(ID_is_bridge_method, m.is_bridge);

// do we need to add 'this' as a parameter?
if(!m.is_static)
{
Expand Down
11 changes: 6 additions & 5 deletions jbmc/src/java_bytecode/java_bytecode_parse_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ struct java_bytecode_parse_treet
struct methodt : public membert
{
irep_idt base_name;
bool is_native, is_abstract, is_synchronized;
bool is_native, is_abstract, is_synchronized, is_bridge;
source_locationt source_location;

typedef std::vector<instructiont> instructionst;
Expand Down Expand Up @@ -164,10 +164,11 @@ struct java_bytecode_parse_treet

void output(std::ostream &out) const;

methodt():
is_native(false),
is_abstract(false),
is_synchronized(false)
methodt()
: is_native(false),
is_abstract(false),
is_synchronized(false),
is_bridge(false)
{
}
};
Expand Down
1 change: 1 addition & 0 deletions jbmc/src/java_bytecode/java_bytecode_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1766,6 +1766,7 @@ void java_bytecode_parsert::rmethod(classt &parsed_class)
method.is_private=(access_flags&ACC_PRIVATE)!=0;
method.is_synchronized=(access_flags&ACC_SYNCHRONIZED)!=0;
method.is_native=(access_flags&ACC_NATIVE)!=0;
method.is_bridge = (access_flags & ACC_BRIDGE) != 0;
method.name=pool_entry(name_index).s;
method.base_name=pool_entry(name_index).s;
method.descriptor=id2string(pool_entry(descriptor_index).s);
Expand Down
1 change: 1 addition & 0 deletions src/util/irep_ids.def
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,7 @@ IREP_ID_TWO(C_must_not_throw, #must_not_throw)
IREP_ID_ONE(is_inner_class)
IREP_ID_ONE(is_anonymous)
IREP_ID_ONE(outer_class)
IREP_ID_ONE(is_bridge_method)

// Projects depending on this code base that wish to extend the list of
// available ids should provide a file local_irep_ids.h in their source tree and
Expand Down

0 comments on commit efadba2

Please sign in to comment.