Skip to content

Commit 0478488

Browse files
committed
pointer-analysis: use new symbolt constructors
To the extent possible, apply resource-acquisition-is-initialisation. The constructors ensure that at least the most essential fields (name, type, mode) are set.
1 parent dbc15e8 commit 0478488

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/pointer-analysis/add_failed_symbols.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,13 @@ void add_failed_symbol(symbolt &symbol, symbol_table_baset &symbol_table)
3636
{
3737
if(symbol.type.id()==ID_pointer)
3838
{
39-
symbolt new_symbol;
39+
symbolt new_symbol{
40+
failed_symbol_id(symbol.name),
41+
to_pointer_type(symbol.type).base_type(),
42+
symbol.mode};
4043
new_symbol.is_lvalue=true;
4144
new_symbol.module=symbol.module;
42-
new_symbol.mode=symbol.mode;
4345
new_symbol.base_name=failed_symbol_id(symbol.base_name);
44-
new_symbol.name=failed_symbol_id(symbol.name);
45-
new_symbol.type = to_pointer_type(symbol.type).base_type();
46-
new_symbol.value.make_nil();
4746
new_symbol.type.set(ID_C_is_failed_symbol, true);
4847

4948
symbol.type.set(ID_C_failed_symbol, new_symbol.name);

0 commit comments

Comments
 (0)