Don't set succ_nodes for substatements in returnStmt and init_expr_trans

Summary: public
In both functions, there is no need to pass anything in succ_nodes since nodes will be connected later anyway.
This will allow to create node later (will be done in separate diff)

Reviewed By: dulmarod

Differential Revision: D2699693

fb-gh-sync-id: 4396d31
master
Andrzej Kotulski 9 years ago committed by facebook-github-bot-5
parent 9353c7bbfd
commit 0d1af3cc46

@ -1597,7 +1597,9 @@ struct
let line_number = CLocation.get_line stmt_info pln in let line_number = CLocation.get_line stmt_info pln in
(* if ie is a block the translation need to be done with the block special cases by exec_with_block_priority*) (* if ie is a block the translation need to be done with the block special cases by exec_with_block_priority*)
let res_trans_ie = let res_trans_ie =
let trans_state' = { trans_state_pri with succ_nodes = next_node; parent_line_number = line_number } in let trans_state' = { trans_state_pri with
succ_nodes = [];
parent_line_number = line_number } in
let instruction' = let instruction' =
exec_with_self_exception (exec_with_lvalue_as_reference instruction) in exec_with_self_exception (exec_with_lvalue_as_reference instruction) in
exec_with_block_priority_exception instruction' trans_state' ie var_stmt_info in exec_with_block_priority_exception instruction' trans_state' ie var_stmt_info in
@ -1822,7 +1824,9 @@ struct
Cfg.Node.set_succs_exn ret_node [(Cfg.Procdesc.get_exit_node context.CContext.procdesc)] []; Cfg.Node.set_succs_exn ret_node [(Cfg.Procdesc.get_exit_node context.CContext.procdesc)] [];
let trans_result = (match stmt_list with let trans_result = (match stmt_list with
| [stmt] -> (* return exp; *) | [stmt] -> (* return exp; *)
let trans_state' = { trans_state_pri with succ_nodes = [ret_node]; parent_line_number = line_number } in let trans_state' = { trans_state_pri with
succ_nodes = [];
parent_line_number = line_number } in
let res_trans_stmt = exec_with_self_exception instruction trans_state' stmt in let res_trans_stmt = exec_with_self_exception instruction trans_state' stmt in
let (sil_expr, sil_typ) = extract_exp_from_list res_trans_stmt.exps let (sil_expr, sil_typ) = extract_exp_from_list res_trans_stmt.exps
"WARNING: There should be only one return expression.\n" in "WARNING: There should be only one return expression.\n" in

Loading…
Cancel
Save