File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
- KNOWNBUG
1
+ CORE
2
2
return_type1.c
3
3
return_type2.c
4
4
^EXIT=0$
Original file line number Diff line number Diff line change @@ -189,7 +189,13 @@ void remove_returnst::do_function_calls(
189
189
exprt rhs;
190
190
191
191
if (!is_stub)
192
- rhs=return_value;
192
+ {
193
+ // The return type in the definition of the function may differ
194
+ // from the return type in the declaration. We therefore do a
195
+ // cast.
196
+ rhs = typecast_exprt::conditional_cast (
197
+ return_value, function_call.lhs ().type ());
198
+ }
193
199
else
194
200
rhs = side_effect_expr_nondett (
195
201
function_call.lhs ().type (), i_it->source_location );
@@ -208,7 +214,7 @@ void remove_returnst::do_function_calls(
208
214
goto_programt::targett t_d=goto_program.insert_after (t_a);
209
215
t_d->make_dead ();
210
216
t_d->source_location =i_it->source_location ;
211
- t_d->code = code_deadt (rhs );
217
+ t_d->code = code_deadt (return_value );
212
218
t_d->function =i_it->function ;
213
219
}
214
220
}
You can’t perform that action at this time.
0 commit comments