Skip to content

Commit

Permalink
smtr: More sanitization
Browse files Browse the repository at this point in the history
  • Loading branch information
KrystalDelusion committed Aug 29, 2024
1 parent 969f201 commit 3a6139b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions backends/functional/smtlib_rosette.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ using SExprUtil::list;
const char *reserved_keywords[] = {
// reserved keywords from the racket spec
"struct", "lambda", "values", "extract", "concat", "bv", "let", "define", "cons", "list", "read", "write",
"stream", "error", "raise", "exit", "for", "for/list", "begin", "when", "unless", "module", "require",
"provide", "apply", "if", "cond", "even", "odd", "any", "and", "or", "match", "match-define", "values",
"stream", "error", "raise", "exit", "for", "begin", "when", "unless", "module", "require", "provide", "apply",
"if", "cond", "even", "odd", "any", "and", "or", "match", "command-line", "ffi-lib", "thread", "kill", "sync",
"future", "touch", "subprocess", "make-custodian", "custodian-shutdown-all", "current-custodian", "make", "tcp",
"connect", "prepare", "malloc", "free", "_fun", "_cprocedure", "build", "path", "file", "peek", "bytes",
"flush", "with", "lexer", "parser", "syntax", "interface", "send", "make-object", "new", "instantiate",
"define-generics", "set",

// reserved for our own purposes
"inputs", "state", "name",
Expand All @@ -45,7 +49,7 @@ struct SmtrScope : public Functional::Scope<int> {
reserve(*p);
}
bool is_character_legal(char c, int index) override {
return isascii(c) && (isalpha(c) || (isdigit(c) && index > 0) || strchr("~!@$%^&*_-+=<>.?/", c));
return isascii(c) && (isalpha(c) || (isdigit(c) && index > 0) || strchr("@$%^&_+=.", c));
}
};

Expand Down

0 comments on commit 3a6139b

Please sign in to comment.