Skip to content

Commit 682ced2

Browse files
author
kroening
committed
phi nodes are now L1
git-svn-id: svn+ssh://svn.cprover.org/srv/svn/cbmc/trunk@890 6afb6bc1-c8e4-404c-8f48-9ae832c5b171
1 parent 3875c4f commit 682ced2

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

src/goto-symex/symex_goto.cpp

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -296,33 +296,34 @@ void goto_symext::phi_function(
296296
it!=variables.end();
297297
it++)
298298
{
299-
if(*it==guard_identifier)
299+
const irep_idt l1_identifier=*it;
300+
301+
if(l1_identifier==guard_identifier)
300302
continue; // just a guard, don't bother
301303

302-
if(goto_state.level2.current_count(*it)==
303-
dest_state.level2.current_count(*it))
304+
if(goto_state.level2.current_count(l1_identifier)==
305+
dest_state.level2.current_count(l1_identifier))
304306
continue; // not at all changed
305307

306-
irep_idt original_identifier=
307-
dest_state.get_original_name(*it);
308-
309308
// changed!
310-
const symbolt &symbol=ns.lookup(original_identifier);
311309

312-
typet type(symbol.type);
310+
irep_idt original_identifier=
311+
dest_state.get_original_name(l1_identifier);
313312

314-
// type may need renaming
313+
// get type (may need renaming)
314+
const symbolt &symbol=ns.lookup(original_identifier);
315+
typet type=symbol.type;
315316
dest_state.rename(type, ns);
316317

317318
exprt rhs;
318319

319320
if(dest_state.guard.is_false())
320321
{
321-
rhs=symbol_exprt(dest_state.current_name(goto_state, ns, symbol.name), type);
322+
rhs=symbol_exprt(goto_state.level2.current_name(l1_identifier), type);
322323
}
323324
else if(goto_state.guard.is_false())
324325
{
325-
rhs=symbol_exprt(dest_state.current_name(ns, symbol.name), type);
326+
rhs=symbol_exprt(dest_state.level2.current_name(l1_identifier), type);
326327
}
327328
else
328329
{
@@ -334,14 +335,12 @@ void goto_symext::phi_function(
334335
rhs=if_exprt();
335336
rhs.type()=type;
336337
rhs.op0()=tmp_guard.as_expr();
337-
rhs.op1()=symbol_exprt(dest_state.current_name(goto_state, ns, symbol.name), type);
338-
rhs.op2()=symbol_exprt(dest_state.current_name(ns, symbol.name), type);
338+
rhs.op1()=symbol_exprt(goto_state.level2.current_name(l1_identifier), type);
339+
rhs.op2()=symbol_exprt(dest_state.level2.current_name(l1_identifier), type);
339340
}
340341

341342
symbol_exprt lhs=symbol_expr(symbol);
342-
symbol_exprt new_lhs=lhs;
343-
344-
dest_state.rename(new_lhs, ns, goto_symex_statet::L1);
343+
symbol_exprt new_lhs=symbol_exprt(l1_identifier, type);
345344
dest_state.assignment(new_lhs, rhs, ns, false);
346345

347346
guardt true_guard;

0 commit comments

Comments
 (0)