Skip to content

Commit 5a50186

Browse files
committed
Use optionalt<symbol_exprt> to avoid deprecated default constructor of symbol_exprt
The implementation here is highly incomplete, in particular those symbols are never set. If at some future date the implementation is completed then the type of those members might be changed again.
1 parent 3957f80 commit 5a50186

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/goto-instrument/concurrency.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Date: October 2012
1515

1616
#include <util/find_symbols.h>
1717
#include <util/invariant.h>
18+
#include <util/optional.h>
1819
#include <util/replace_symbol.h>
1920
#include <util/std_expr.h>
2021

@@ -58,14 +59,14 @@ class concurrency_instrumentationt
5859
{
5960
public:
6061
typet type;
61-
symbol_exprt array_symbol, w_index_symbol;
62+
optionalt<symbol_exprt> array_symbol, w_index_symbol;
6263
};
6364

6465
class thread_local_vart
6566
{
6667
public:
6768
typet type;
68-
symbol_exprt array_symbol;
69+
optionalt<symbol_exprt> array_symbol;
6970
};
7071

7172
typedef std::map<irep_idt, shared_vart> shared_varst;
@@ -101,7 +102,7 @@ void concurrency_instrumentationt::instrument(exprt &expr)
101102
// initialized anywhere
102103
const shared_vart &shared_var = v_it->second;
103104
const index_exprt new_expr(
104-
shared_var.array_symbol, shared_var.w_index_symbol);
105+
*shared_var.array_symbol, *shared_var.w_index_symbol);
105106

106107
replace_symbol.insert(s, new_expr);
107108
}

0 commit comments

Comments
 (0)