Skip to content

Commit a01053d

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 c45dbfa commit a01053d

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
@@ -1856,6 +1856,7 @@ void java_bytecode_parsert::rmethod(classt &parsed_class)
18561856
method.is_synchronized =
18571857
(access_flags & method_access_flagst::SYNCHRONIZED) != 0;
18581858
method.is_native = (access_flags & method_access_flagst::NATIVE) != 0;
1859+
method.is_bridge = (access_flags & method_access_flagst::BRIDGE) != 0;
18591860
method.name=pool_entry(name_index).s;
18601861
method.base_name=pool_entry(name_index).s;
18611862
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
@@ -677,6 +677,7 @@ IREP_ID_ONE(always_inline)
677677
IREP_ID_ONE(is_always_inline)
678678
IREP_ID_ONE(is_inner_class)
679679
IREP_ID_ONE(is_anonymous)
680+
IREP_ID_ONE(is_bridge_method)
680681

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

0 commit comments

Comments
 (0)