mirror of
https://github.com/Z3Prover/z3
synced 2025-12-21 11:43:43 +00:00
fix for #975, add mask to ensure character encoding is unique within range of bits used for encoding
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
7bb5e72e07
commit
48638c6f1e
2 changed files with 6 additions and 2 deletions
|
|
@ -126,13 +126,14 @@ static bool is_escape_char(char const *& s, unsigned& result) {
|
|||
zstring::zstring(encoding enc): m_encoding(enc) {}
|
||||
|
||||
zstring::zstring(char const* s, encoding enc): m_encoding(enc) {
|
||||
unsigned mask = 0xFF; // TBD for UTF
|
||||
while (*s) {
|
||||
unsigned ch;
|
||||
if (is_escape_char(s, ch)) {
|
||||
m_buffer.push_back(ch);
|
||||
m_buffer.push_back(ch & mask);
|
||||
}
|
||||
else {
|
||||
m_buffer.push_back(*s);
|
||||
m_buffer.push_back(*s & mask);
|
||||
++s;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue