diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-04-27 16:58:52 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-04-28 01:16:42 +0800 |
commit | 8020144d06e035cfac1d2621e732bc7354c56e2c (patch) | |
tree | bf6c6c958c8be9db3791df890c3ab15620a32c01 | |
parent | 01b60a4f8d7d9676d35c582d8ba265d10e4b65da (diff) | |
download | dexon-solidity-8020144d06e035cfac1d2621e732bc7354c56e2c.tar dexon-solidity-8020144d06e035cfac1d2621e732bc7354c56e2c.tar.gz dexon-solidity-8020144d06e035cfac1d2621e732bc7354c56e2c.tar.bz2 dexon-solidity-8020144d06e035cfac1d2621e732bc7354c56e2c.tar.lz dexon-solidity-8020144d06e035cfac1d2621e732bc7354c56e2c.tar.xz dexon-solidity-8020144d06e035cfac1d2621e732bc7354c56e2c.tar.zst dexon-solidity-8020144d06e035cfac1d2621e732bc7354c56e2c.zip |
Do not validate identifiers against EVM instructions in JULIA
-rw-r--r-- | libsolidity/inlineasm/AsmParser.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libsolidity/inlineasm/AsmParser.cpp b/libsolidity/inlineasm/AsmParser.cpp index 9513cf77..848e488d 100644 --- a/libsolidity/inlineasm/AsmParser.cpp +++ b/libsolidity/inlineasm/AsmParser.cpp @@ -24,6 +24,7 @@ #include <ctype.h> #include <algorithm> #include <libsolidity/parsing/Scanner.h> +#include <libsolidity/interface/Exceptions.h> using namespace std; using namespace dev; @@ -73,7 +74,7 @@ assembly::Statement Parser::parseStatement() expectToken(Token::Colon); assignment.variableName.location = location(); assignment.variableName.name = m_scanner->currentLiteral(); - if (instructions().count(assignment.variableName.name)) + if (!m_julia && instructions().count(assignment.variableName.name)) fatalParserError("Identifier expected, got instruction name."); assignment.location.end = endPosition(); expectToken(Token::Identifier); @@ -105,7 +106,7 @@ assembly::Statement Parser::parseStatement() { // functional assignment FunctionalAssignment funAss = createWithLocation<FunctionalAssignment>(identifier.location); - if (instructions().count(identifier.name)) + if (!m_julia && instructions().count(identifier.name)) fatalParserError("Cannot use instruction names for identifier names."); m_scanner->next(); funAss.variableName = identifier; @@ -180,7 +181,7 @@ assembly::Statement Parser::parseElementaryOperation(bool _onlySinglePusher) else literal = m_scanner->currentLiteral(); // first search the set of instructions. - if (instructions().count(literal)) + if (!m_julia && instructions().count(literal)) { dev::solidity::Instruction const& instr = instructions().at(literal); if (_onlySinglePusher) @@ -259,6 +260,7 @@ assembly::Statement Parser::parseFunctionalInstruction(assembly::Statement&& _in { if (_instruction.type() == typeid(Instruction)) { + solAssert(!m_julia, "Instructions are invalid in JULIA"); FunctionalInstruction ret; ret.instruction = std::move(boost::get<Instruction>(_instruction)); ret.location = ret.instruction.location; @@ -321,7 +323,7 @@ assembly::Statement Parser::parseFunctionalInstruction(assembly::Statement&& _in string Parser::expectAsmIdentifier() { string name = m_scanner->currentLiteral(); - if (instructions().count(name)) + if (!m_julia && instructions().count(name)) fatalParserError("Cannot use instruction names for identifier names."); expectToken(Token::Identifier); return name; |