Skip to content

Commit e83e307

Browse files
Fixed scope of moved symbol
Because symbol was declared in outer scope it was being reused after being moved. In practice this was not causing problems, but to avoid headaches it is better to move it to the loop scope so that it is reinitialised before being reused after being moved.
1 parent a6adb19 commit e83e307

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/util/fresh_symbol.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,10 @@ symbolt &get_fresh_aux_symbol(
3838
const irep_idt &symbol_mode,
3939
symbol_tablet &symbol_table)
4040
{
41-
auxiliary_symbolt new_symbol;
42-
4341
// Loop until find a name that doesn't clash with a non-auxilliary symbol
4442
while(true)
4543
{
44+
auxiliary_symbolt new_symbol;
4645
// Distinguish local variables with the same name
4746
new_symbol.base_name=
4847
basename_prefix+"$"+std::to_string(++temporary_counter);

0 commit comments

Comments
 (0)