Skip to content

Commit efadba2

Browse files
thk123jeannielynnmoulton
thk123
authored andcommitted
Read the bride flag for methods
This is used for compiler generated methods to deal with type erasure.
1 parent a18b32d commit efadba2

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

jbmc/src/java_bytecode/java_bytecode_convert_method.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,9 @@ void java_bytecode_convert_method_lazy(
371371
if(m.is_static)
372372
member_type.set(ID_is_static, true);
373373

374+
if(m.is_bridge)
375+
member_type.set(ID_is_bridge_method, m.is_bridge);
376+
374377
// do we need to add 'this' as a parameter?
375378
if(!m.is_static)
376379
{

jbmc/src/java_bytecode/java_bytecode_parse_tree.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ struct java_bytecode_parse_treet
8686
struct methodt : public membert
8787
{
8888
irep_idt base_name;
89-
bool is_native, is_abstract, is_synchronized;
89+
bool is_native, is_abstract, is_synchronized, is_bridge;
9090
source_locationt source_location;
9191

9292
typedef std::vector<instructiont> instructionst;
@@ -164,10 +164,11 @@ struct java_bytecode_parse_treet
164164

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

167-
methodt():
168-
is_native(false),
169-
is_abstract(false),
170-
is_synchronized(false)
167+
methodt()
168+
: is_native(false),
169+
is_abstract(false),
170+
is_synchronized(false),
171+
is_bridge(false)
171172
{
172173
}
173174
};

jbmc/src/java_bytecode/java_bytecode_parser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,6 +1766,7 @@ void java_bytecode_parsert::rmethod(classt &parsed_class)
17661766
method.is_private=(access_flags&ACC_PRIVATE)!=0;
17671767
method.is_synchronized=(access_flags&ACC_SYNCHRONIZED)!=0;
17681768
method.is_native=(access_flags&ACC_NATIVE)!=0;
1769+
method.is_bridge = (access_flags & ACC_BRIDGE) != 0;
17691770
method.name=pool_entry(name_index).s;
17701771
method.base_name=pool_entry(name_index).s;
17711772
method.descriptor=id2string(pool_entry(descriptor_index).s);

src/util/irep_ids.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,7 @@ IREP_ID_TWO(C_must_not_throw, #must_not_throw)
676676
IREP_ID_ONE(is_inner_class)
677677
IREP_ID_ONE(is_anonymous)
678678
IREP_ID_ONE(outer_class)
679+
IREP_ID_ONE(is_bridge_method)
679680

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

0 commit comments

Comments
 (0)