@@ -135,7 +135,7 @@ class java_bytecode_convert_methodt:public messaget
135
135
if (var.symbol_expr .get_identifier ().empty ())
136
136
{
137
137
// an un-named local variable
138
- irep_idt base_name=" __anonlocal " +id2string (number)+type_char;
138
+ irep_idt base_name=" anonlocal:: " +id2string (number)+type_char;
139
139
irep_idt identifier=id2string (current_method)+" ::" +id2string (base_name);
140
140
141
141
symbol_exprt result (identifier, t);
@@ -295,8 +295,6 @@ void java_bytecode_convert_methodt::convert(
295
295
296
296
variables.clear ();
297
297
298
- std::set<std::string> unique_local_names;
299
-
300
298
// Do the parameters and locals in the variable table, which is available when
301
299
// compiled with -g or for methods with many local variables in the latter
302
300
// case, different variables can have the same index, depending on the
@@ -309,26 +307,11 @@ void java_bytecode_convert_methodt::convert(
309
307
{
310
308
typet t=java_type_from_string (v.signature );
311
309
size_t unique_number=0 ;
312
- std::string unique_id;
313
- std::string infix;
314
- // Avoid clashing with anonymous locals:
315
- if (has_prefix (as_string (v.name )," __anonlocal" ))
316
- infix=" _" ;
317
- // Avoid clashing with other named locals with disjoint scopes
318
- // (no sub-function-block-scoping in GOTO programs afaik!)
319
- do {
320
- std::ostringstream id_oss;
321
- id_oss << infix << v.name ;
322
- size_t this_suffix=unique_number++;
323
- if (this_suffix!=0 )
324
- id_oss << this_suffix;
325
- unique_id=id_oss.str ();
326
- } while (!unique_local_names.insert (unique_id).second );
327
- std::ostringstream scoped_name;
328
- scoped_name << method_identifier << " ::" << unique_id;
329
- irep_idt identifier (scoped_name.str ());
310
+ std::ostringstream id_oss;
311
+ id_oss << method_identifier << " ::" << v.start_pc << " ::" << v.name ;
312
+ irep_idt identifier (id_oss.str ());
330
313
symbol_exprt result (identifier, t);
331
- result.set (ID_C_base_name, irep_idt (unique_id) );
314
+ result.set (ID_C_base_name, v. name );
332
315
size_t number_index_entries = variables[v.index ].size ();
333
316
variables[v.index ].resize (number_index_entries + 1 );
334
317
variables[v.index ][number_index_entries].symbol_expr = result;
0 commit comments