Skip to content

Include function and parameter in convert_function error messages #6426

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 2 commits into from
Dec 1, 2021
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
4 changes: 2 additions & 2 deletions COMPILING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#WHAT ARCHITECTURE ?
# What architecture?

CPROVER now needs a C++11 compliant compiler and is known to work in the
following environments:
Expand All @@ -18,7 +18,7 @@ past, but are not actively tested:
- Solaris 11
- FreeBSD 11

#Building using CMake
# Building using CMake

Building with CMake is supported across Linux, MacOS X and Windows with Visual
Studio 2019. There are also hand-written make files which can be used to build
Expand Down
15 changes: 12 additions & 3 deletions src/goto-programs/goto_convert_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,19 @@ void goto_convert_functionst::convert_function(
// we have a body, make sure all parameter names are valid
for(const auto &p : f.parameter_identifiers)
{
DATA_INVARIANT(!p.empty(), "parameter identifier should not be empty");
DATA_INVARIANT(
DATA_INVARIANT_WITH_DIAGNOSTICS(
!p.empty(),
"parameter identifier should not be empty",
"function:",
identifier);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't make sense: when the message is triggered, p is empty. Thus, why log it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Removed p from this case.

DATA_INVARIANT_WITH_DIAGNOSTICS(
symbol_table.has_symbol(p),
"parameter identifier must be a known symbol");
"parameter identifier must be a known symbol",
"function:",
identifier,
"parameter:",
p);
}

lifetimet parent_lifetime = lifetime;
Expand Down