3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-27 19:05:51 +00:00

fix string constant representation in parser

spec1 loopback OK
This commit is contained in:
Murphy Berzish 2015-09-03 00:17:05 -04:00
parent e48ac4a97a
commit 02345ee5f1
6 changed files with 38 additions and 7 deletions

View file

@ -1064,8 +1064,13 @@ namespace smt2 {
void parse_string() {
SASSERT(curr() == scanner::STRING_TOKEN);
TRACE("parse_string", tout << "new string constant: " << m_scanner.get_string() << "\n";);
expr_stack().push_back(strutil().mk_string(m_scanner.get_string()));
char const *original_token = m_scanner.get_string();
size_t bufsize = strlen(original_token);
char * buf = alloc_svect(char, bufsize + 1);
strncpy(buf, original_token, bufsize);
buf[bufsize] = '\0';
TRACE("parse_string", tout << "new string constant: " << buf << " length=" << bufsize << "\n";);
expr_stack().push_back(strutil().mk_string(buf));
next();
}