@@ -927,10 +927,11 @@ void c_typecheck_baset::typecheck_side_effect_statement_expression(
927927
928928 code_function_callt &fc=to_code_function_call (last);
929929
930- const auto &return_type = to_code_type (fc.function ().type ()).return_type ();
931-
932930 side_effect_expr_function_callt sideeffect (
933- fc.function (), fc.arguments (), return_type, fc.source_location ());
931+ fc.function (),
932+ fc.arguments (),
933+ to_code_type (fc.function ().type ()).return_type (),
934+ fc.source_location ());
934935
935936 expr.type ()=sideeffect.type ();
936937
@@ -1987,7 +1988,7 @@ void c_typecheck_baset::typecheck_side_effect_function_call(
19871988 // This is an undeclared function that's not a builtin.
19881989 // Let's just add it.
19891990 // We do a bit of return-type guessing, but just a bit.
1990- typet return_type= signed_int_type ();
1991+ typet guessed_return_type = signed_int_type ();
19911992
19921993 // The following isn't really right and sound, but there
19931994 // are too many idiots out there who use malloc and the like
@@ -1996,14 +1997,16 @@ void c_typecheck_baset::typecheck_side_effect_function_call(
19961997 identifier==" realloc" ||
19971998 identifier==" reallocf" ||
19981999 identifier==" valloc" )
1999- return_type=pointer_type (void_type ()); // void *
2000+ {
2001+ guessed_return_type = pointer_type (void_type ()); // void *
2002+ }
20002003
20012004 symbolt new_symbol;
20022005
20032006 new_symbol.name =identifier;
20042007 new_symbol.base_name =identifier;
20052008 new_symbol.location =expr.source_location ();
2006- new_symbol.type = code_typet ({}, return_type );
2009+ new_symbol.type = code_typet ({}, guessed_return_type );
20072010 new_symbol.type .set (ID_C_incomplete, true );
20082011
20092012 // TODO: should also guess some argument types
0 commit comments