File tree 2 files changed +5
-54
lines changed
2 files changed +5
-54
lines changed Original file line number Diff line number Diff line change @@ -916,43 +916,13 @@ void c_typecheck_baset::typecheck_side_effect_statement_expression(
916
916
917
917
expr.type ()=op.type ();
918
918
}
919
- else if (last_statement==ID_function_call)
919
+ else
920
920
{
921
- // this is suspected to be dead
922
- UNREACHABLE;
923
-
924
- // make the last statement an expression
925
-
926
- code_function_callt &fc=to_code_function_call (last);
927
-
928
- side_effect_expr_function_callt sideeffect (
929
- fc.function (),
930
- fc.arguments (),
931
- to_code_type (fc.function ().type ()).return_type (),
932
- fc.source_location ());
921
+ // we used to do this, but don't expect it any longer
922
+ PRECONDITION (last_statement != ID_function_call);
933
923
934
- expr.type ()=sideeffect.type ();
935
-
936
- if (fc.lhs ().is_nil ())
937
- {
938
- code_expressiont code_expr (sideeffect);
939
- code_expr.add_source_location () = fc.source_location ();
940
- last.swap (code_expr);
941
- }
942
- else
943
- {
944
- side_effect_exprt assign (
945
- ID_assign, sideeffect.type (), fc.source_location ());
946
- assign.add_to_operands (fc.lhs (), std::move (sideeffect));
947
-
948
- code_expressiont code_expr (assign);
949
- code_expr.add_source_location () = fc.source_location ();
950
-
951
- last.swap (code_expr);
952
- }
953
- }
954
- else
955
924
expr.type ()=typet (ID_empty);
925
+ }
956
926
}
957
927
958
928
void c_typecheck_baset::typecheck_expr_sizeof (exprt &expr)
Original file line number Diff line number Diff line change @@ -40,26 +40,7 @@ void goto_symext::symex_assign(
40
40
const side_effect_exprt &side_effect_expr=to_side_effect_expr (rhs);
41
41
const irep_idt &statement=side_effect_expr.get_statement ();
42
42
43
- if (statement==ID_function_call)
44
- {
45
- const auto &function_call =
46
- to_side_effect_expr_function_call (side_effect_expr);
47
-
48
- DATA_INVARIANT (
49
- !side_effect_expr.operands ().empty (),
50
- " function call statement expects non-empty list of side effects" );
51
-
52
- DATA_INVARIANT (
53
- function_call.function ().id () == ID_symbol,
54
- " expected symbol as function" );
55
-
56
- const irep_idt &identifier =
57
- to_symbol_expr (function_call.function ()).get_identifier ();
58
-
59
- throw unsupported_operation_exceptiont (
60
- " symex_assign: unexpected function call: " + id2string (identifier));
61
- }
62
- else if (
43
+ if (
63
44
statement == ID_cpp_new || statement == ID_cpp_new_array ||
64
45
statement == ID_java_new_array_data)
65
46
symex_cpp_new (state, lhs, side_effect_expr);
You can’t perform that action at this time.
0 commit comments