diff options
author | Tianyi Liang <tianyi-liang@uiowa.edu> | 2014-05-13 15:22:38 -0500 |
---|---|---|
committer | Tianyi Liang <tianyi-liang@uiowa.edu> | 2014-05-13 15:22:38 -0500 |
commit | e0a291555fc4710c39a75eac19039a063c166cea (patch) | |
tree | 6a2827ab3c0c57ad755eb7445938bcdb7deded06 /src | |
parent | 0e93990c11ce047bb781c06f50ca6410103b8606 (diff) |
Reject native extended ASCII characters. It requires user to use escaped sequence for an extended ASCII character.
Diffstat (limited to 'src')
-rw-r--r-- | src/parser/smt2/Smt2.g | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/parser/smt2/Smt2.g b/src/parser/smt2/Smt2.g index 8dcebc5ee..b3761dfbd 100644 --- a/src/parser/smt2/Smt2.g +++ b/src/parser/smt2/Smt2.g @@ -1263,6 +1263,11 @@ str[std::string& s, bool fsmtlib] { s = AntlrInput::tokenText($STRING_LITERAL); /* strip off the quotes */ s = s.substr(1, s.size() - 2); + for(size_t i=0; i<s.size(); i++) { + if((unsigned)s[i] > 127) { + PARSER_STATE->parseError("Extended characters are not part of SMT-LIB, and they must be encoded as esacped sequences"); + } + } if(fsmtlib) { /* handle SMT-LIB standard escapes '\\' and '\"' */ char* p_orig = strdup(s.c_str()); |