Skip to content

Commit 9103a31

Browse files
author
thk123
committed
Read the bride flag for methods
This is used for compiler generated methods to deal with type erasure.
1 parent 3c2e55e commit 9103a31

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
@@ -95,7 +95,7 @@ class java_bytecode_parse_treet
9595
{
9696
public:
9797
irep_idt base_name;
98-
bool is_native, is_abstract, is_synchronized;
98+
bool is_native, is_abstract, is_synchronized, is_bridge;
9999
source_locationt source_location;
100100

101101
typedef std::vector<instructiont> instructionst;
@@ -177,10 +177,11 @@ class java_bytecode_parse_treet
177177

178178
virtual void output(std::ostream &out) const;
179179

180-
methodt():
181-
is_native(false),
182-
is_abstract(false),
183-
is_synchronized(false)
180+
methodt()
181+
: is_native(false),
182+
is_abstract(false),
183+
is_synchronized(false),
184+
is_bridge(false)
184185
{
185186
}
186187

jbmc/src/java_bytecode/java_bytecode_parser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,6 +1765,7 @@ void java_bytecode_parsert::rmethod(classt &parsed_class)
17651765
method.is_private=(access_flags&ACC_PRIVATE)!=0;
17661766
method.is_synchronized=(access_flags&ACC_SYNCHRONIZED)!=0;
17671767
method.is_native=(access_flags&ACC_NATIVE)!=0;
1768+
method.is_bridge = (access_flags & ACC_BRIDGE) != 0;
17681769
method.name=pool_entry(name_index).s;
17691770
method.base_name=pool_entry(name_index).s;
17701771
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
@@ -675,6 +675,7 @@ IREP_ID_ONE(interface)
675675
IREP_ID_TWO(C_must_not_throw, #must_not_throw)
676676
IREP_ID_ONE(is_inner_class)
677677
IREP_ID_ONE(is_anonymous)
678+
IREP_ID_ONE(is_bridge_method)
678679

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

0 commit comments

Comments
 (0)