Skip to content

Fixed scope of moved symbol #1559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions src/util/fresh_symbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,15 @@ symbolt &get_fresh_aux_symbol(
const irep_idt &symbol_mode,
symbol_tablet &symbol_table)
{
auxiliary_symbolt new_symbol;

// Loop until find a name that doesn't clash with a non-auxilliary symbol
while(true)
{
// Distinguish local variables with the same name
new_symbol.base_name=
basename_prefix+"$"+std::to_string(++temporary_counter);
if(name_prefix.empty())
new_symbol.name=new_symbol.base_name;
else
auxiliary_symbolt new_symbol(
// Distinguish local variables with the same name
basename_prefix + "$" + std::to_string(++temporary_counter),
type);
if(!name_prefix.empty())
new_symbol.name=name_prefix+"::"+id2string(new_symbol.base_name);
new_symbol.type=type;
new_symbol.location=source_location;
new_symbol.mode=symbol_mode;
std::pair<symbolt &, bool> res=symbol_table.insert(std::move(new_symbol));
Expand Down