File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,26 @@ void remove_exceptionst::add_exceptional_returns(
90
90
if (goto_program.empty ())
91
91
return ;
92
92
93
+ // the entry function has already been added to the symbol table
94
+ // if you find it, initialise it
95
+ if (symbol_table.has_symbol (id2string (function_id)+EXC_SUFFIX))
96
+ {
97
+ const symbolt &symbol=
98
+ symbol_table.lookup (id2string (function_id)+EXC_SUFFIX);
99
+ symbol_exprt lhs_expr_null=symbol.symbol_expr ();
100
+ null_pointer_exprt rhs_expr_null ((pointer_typet (empty_typet ())));
101
+ goto_programt::targett t_null=
102
+ goto_program.insert_before (goto_program.instructions .begin ());
103
+ t_null->make_assignment ();
104
+ t_null->source_location =
105
+ goto_program.instructions .begin ()->source_location ;
106
+ t_null->code =code_assignt (
107
+ lhs_expr_null,
108
+ rhs_expr_null);
109
+ t_null->function =function_id;
110
+ return ;
111
+ }
112
+
93
113
// We generate an exceptional return value for any function that has
94
114
// a throw or a function call. This can be improved by only considering
95
115
// function calls that may escape exceptions. However, this will
You can’t perform that action at this time.
0 commit comments