File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -232,27 +232,29 @@ void cpp_typecheckt::do_not_typechecked()
232232 symbol.value .get_bool (ID_is_used))
233233 {
234234 assert (symbol.type .id ()==ID_code);
235- symbolt &symbol=*symbol_table. get_writeable (named_symbol. first ) ;
235+ exprt value = symbol. value ;
236236
237237 if (symbol.base_name ==" operator=" )
238238 {
239239 cpp_declaratort declarator;
240240 declarator.add_source_location () = symbol.location ;
241241 default_assignop_value (
242242 lookup (symbol.type .get (ID_C_member_name)), declarator);
243- symbol.value .swap (declarator.value ());
244- convert_function (symbol);
243+ value.swap (declarator.value ());
245244 cont=true ;
246245 }
247246 else if (symbol.value .operands ().size ()==1 )
248247 {
249- exprt tmp = symbol.value .op0 ();
250- symbol.value .swap (tmp);
251- convert_function (symbol);
248+ value = symbol.value .op0 ();
252249 cont=true ;
253250 }
254251 else
255252 UNREACHABLE; // Don't know what to do!
253+
254+ symbolt &writable_symbol =
255+ *symbol_table.get_writeable (named_symbol.first );
256+ writable_symbol.value .swap (value);
257+ convert_function (writable_symbol);
256258 }
257259 }
258260 }
You can’t perform that action at this time.
0 commit comments