Skip to content

Allow characters with value >= 128 in XML output #7109

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
Sep 8, 2022
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
13 changes: 13 additions & 0 deletions regression/cbmc/xml-escaping/debug_output.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CORE
main.c
--verbosity 10 --xml-ui
^EXIT=10$
^SIGNAL=0$
VERIFICATION FAILED
⇔ false
\¬main\:\:1\:\:x\!0\@1\#1
--
XML does not support escaping non-printable character
--
Test that running cbmc with --verbosity 10 and --xml-ui does not violate any
xml printing invariants.
8 changes: 8 additions & 0 deletions regression/cbmc/xml-escaping/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <assert.h>

int main(void)
{
__CPROVER_bool x;
__CPROVER_assume(!x);
assert(0);
}
4 changes: 2 additions & 2 deletions src/util/xml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void xmlt::escape(const std::string &s, std::ostream &out)

default:
DATA_INVARIANT(
ch >= ' ',
static_cast<unsigned char>(ch) >= 32u,
"XML does not support escaping non-printable character " +
std::to_string((unsigned char)ch));
out << ch;
Expand Down Expand Up @@ -149,7 +149,7 @@ void xmlt::escape_attribute(const std::string &s, std::ostream &out)

default:
DATA_INVARIANT(
ch >= ' ',
static_cast<unsigned char>(ch) >= 32u,
"XML does not support escaping non-printable character " +
std::to_string((unsigned char)ch));
out << ch;
Expand Down