Skip to content

Fix bad return type of char pointer func #1048

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 21, 2017
Merged
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
7 changes: 6 additions & 1 deletion src/solvers/refinement/string_constraint_generator_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,12 @@ exprt string_constraint_generatort::add_axioms_for_char_pointer(
{
exprt char_pointer=args(fun, 1)[0];
if(char_pointer.id()==ID_index)
return char_pointer.op0();
return typecast_exprt(char_pointer.op0(), fun.type());
// TODO: It seems reasonable that the result of the function application
// should match the return type of the function. However it is not
// clear whether this typecast is properly handled in the string
// refinement. We need regression tests that use that function.

// TODO: we do not know what to do in the other cases
assert(false);
return exprt();
Expand Down