aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/formal/Why3Translator.cpp
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2016-10-11 06:07:11 +0800
committerYoichi Hirai <i@yoichihirai.com>2016-10-11 06:07:11 +0800
commitab1f4632aaa8017f80c371eded76497832719404 (patch)
treeb861d94dc21f1d70fa49a3afd0c02003456885fd /libsolidity/formal/Why3Translator.cpp
parent092e5829d868f5b9ce50d5605ce19ca505ec930f (diff)
downloaddexon-solidity-ab1f4632aaa8017f80c371eded76497832719404.tar.gz
dexon-solidity-ab1f4632aaa8017f80c371eded76497832719404.tar.zst
dexon-solidity-ab1f4632aaa8017f80c371eded76497832719404.zip
Chack for non-version pragmas
Diffstat (limited to 'libsolidity/formal/Why3Translator.cpp')
-rw-r--r--libsolidity/formal/Why3Translator.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/libsolidity/formal/Why3Translator.cpp b/libsolidity/formal/Why3Translator.cpp
index 8b50600a..813fa3ab 100644
--- a/libsolidity/formal/Why3Translator.cpp
+++ b/libsolidity/formal/Why3Translator.cpp
@@ -757,8 +757,17 @@ bool Why3Translator::visit(Literal const& _literal)
return false;
}
-bool Why3Translator::visit(PragmaDirective const&)
+bool Why3Translator::visit(PragmaDirective const& _pragma)
{
+ if (_pragma.tokens().empty())
+ error(_pragma, "Not supported");
+ else if (_pragma.literals().empty())
+ error(_pragma, "Not supported");
+ else if (_pragma.literals()[0] != "solidity")
+ error(_pragma, "Not supported");
+ else if (_pragma.tokens()[0] != Token::Identifier)
+ error(_pragma, "A literal 'solidity' is not an identifier. Strange");
+
return false;
}