Skip to content

Commit af8c217

Browse files
Make check in XML output function a precondition
Previously this check would just lead to a silent return when trying to output an empty XML document. As per the comment this is actually an error. Also fixes one instance where this function was used incorrectly in goto-analyzer.
1 parent d9a5113 commit af8c217

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/goto-analyzer/static_verifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static void static_verifier_xml(
6666
{
6767
m.status() << "Writing XML report" << messaget::eom;
6868

69-
xmlt xml_result;
69+
xmlt xml_result{"cprover"};
7070

7171
for(const auto &result : results)
7272
{

src/util/xml.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ void xmlt::output(std::ostream &out, unsigned indent) const
3434
// 'name' needs to be set, or we produce mal-formed
3535
// XML.
3636

37-
if(name.empty())
38-
return;
37+
PRECONDITION(!name.empty());
3938

4039
do_indent(out, indent);
4140

0 commit comments

Comments
 (0)