Skip to content

Commit 0ac4d28

Browse files
Don't store pointers to symbols in map
1 parent 4b245f8 commit 0ac4d28

5 files changed

+7
-6
lines changed

src/java_bytecode/ci_lazy_methods.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ bool ci_lazy_methodst::operator()(
149149
debug() << "CI lazy methods: elaborate " << mname << eom;
150150
const auto &parsed_method=findit->second;
151151
method_converter(
152-
*parsed_method.first,
152+
symbol_table.lookup_ref(parsed_method.first),
153153
*parsed_method.second,
154154
// Note this wraps *references* to method_worklist2 & needed_classes
155155
ci_lazy_methods_neededt(

src/java_bytecode/ci_lazy_methods.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
class java_string_library_preprocesst;
2828

2929
// Pair of class id and methodt
30-
typedef std::pair<const symbolt *, const java_bytecode_parse_treet::methodt *>
30+
typedef std::pair<irep_idt, const java_bytecode_parse_treet::methodt *>
3131
class_and_bytecodet;
3232
// Map from method id to class_and_bytecodet
3333
typedef std::map<irep_idt, class_and_bytecodet> method_bytecodet;

src/java_bytecode/java_bytecode_convert_class.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ void java_bytecode_convert_classt::convert(const classt &c)
205205
method,
206206
symbol_table,
207207
get_message_handler());
208-
method_bytecode[method_identifier] = std::make_pair(class_symbol, &method);
208+
method_bytecode[method_identifier] =
209+
std::make_pair(qualified_classname, &method);
209210
}
210211

211212
// is this a root class?

src/java_bytecode/java_bytecode_language.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ bool java_bytecode_languaget::typecheck(
251251
for(const auto &method_sig : method_bytecode)
252252
{
253253
java_bytecode_convert_method(
254-
*method_sig.second.first,
254+
symbol_table.lookup_ref(method_sig.second.first),
255255
*method_sig.second.second,
256256
symbol_table,
257257
get_message_handler(),
@@ -370,7 +370,7 @@ void java_bytecode_languaget::convert_lazy_method(
370370
{
371371
const auto &lazy_method_entry = method_bytecode.at(function_id);
372372
java_bytecode_convert_method(
373-
*lazy_method_entry.first,
373+
symbol_table.lookup_ref(lazy_method_entry.first),
374374
*lazy_method_entry.second,
375375
symbol_table,
376376
get_message_handler(),

src/java_bytecode/java_bytecode_language.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ struct object_factory_parameterst final
8282
};
8383

8484
// Pair of class id and methodt
85-
typedef std::pair<const symbolt *, const java_bytecode_parse_treet::methodt *>
85+
typedef std::pair<irep_idt, const java_bytecode_parse_treet::methodt *>
8686
class_and_bytecodet;
8787
// Map from method id to class_and_bytecodet
8888
typedef std::map<irep_idt, class_and_bytecodet> method_bytecodet;

0 commit comments

Comments
 (0)