Skip to content

printf does not and should not have a left-hand side #2484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/goto-symex/goto_symex.h
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ class goto_symext
virtual void symex_fkt(statet &, const code_function_callt &);
virtual void symex_macro(statet &, const code_function_callt &);
virtual void symex_trace(statet &, const code_function_callt &);
virtual void symex_printf(statet &, const exprt &lhs, const exprt &rhs);
virtual void symex_printf(statet &, const exprt &rhs);
virtual void symex_input(statet &, const codet &);
virtual void symex_output(statet &, const codet &);

Expand Down
6 changes: 5 additions & 1 deletion src/goto-symex/symex_assign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ void goto_symext::symex_assign(
else if(statement==ID_allocate)
symex_allocate(state, lhs, side_effect_expr);
else if(statement==ID_printf)
symex_printf(state, lhs, side_effect_expr);
{
if(lhs.is_not_nil())
throw "printf: unexpected assignment";
symex_printf(state, side_effect_expr);
}
else if(statement==ID_gcc_builtin_va_arg_next)
symex_gcc_builtin_va_arg_next(state, lhs, side_effect_expr);
else
Expand Down
1 change: 0 additions & 1 deletion src/goto-symex/symex_builtin_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ irep_idt get_string_argument(const exprt &src, const namespacet &ns)

void goto_symext::symex_printf(
statet &state,
const exprt &lhs,
const exprt &rhs)
{
if(rhs.operands().empty())
Expand Down
2 changes: 1 addition & 1 deletion src/goto-symex/symex_other.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void goto_symext::symex_other(
{
codet clean_code=code;
clean_expr(clean_code, state, false);
symex_printf(state, nil_exprt(), clean_code);
symex_printf(state, clean_code);
}
else if(statement==ID_input)
{
Expand Down