diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-01-05 07:25:41 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-02-22 08:02:19 +0800 |
commit | ae02bb5aadfa49636f9931524dbc026c855201f1 (patch) | |
tree | 0328334a01d5198a6f17c97c8ad6fa0c46a52906 /libsolidity/inlineasm/AsmAnalysis.cpp | |
parent | d01786f0aa4e128f70aea2bc53a8d3c61294a587 (diff) | |
download | dexon-solidity-ae02bb5aadfa49636f9931524dbc026c855201f1.tar dexon-solidity-ae02bb5aadfa49636f9931524dbc026c855201f1.tar.gz dexon-solidity-ae02bb5aadfa49636f9931524dbc026c855201f1.tar.bz2 dexon-solidity-ae02bb5aadfa49636f9931524dbc026c855201f1.tar.lz dexon-solidity-ae02bb5aadfa49636f9931524dbc026c855201f1.tar.xz dexon-solidity-ae02bb5aadfa49636f9931524dbc026c855201f1.tar.zst dexon-solidity-ae02bb5aadfa49636f9931524dbc026c855201f1.zip |
Raise error on oversized number literals in assembly
Diffstat (limited to 'libsolidity/inlineasm/AsmAnalysis.cpp')
-rw-r--r-- | libsolidity/inlineasm/AsmAnalysis.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libsolidity/inlineasm/AsmAnalysis.cpp b/libsolidity/inlineasm/AsmAnalysis.cpp index 2d6e58de..e672d5ef 100644 --- a/libsolidity/inlineasm/AsmAnalysis.cpp +++ b/libsolidity/inlineasm/AsmAnalysis.cpp @@ -82,6 +82,14 @@ bool AsmAnalyzer::operator()(assembly::Literal const& _literal) ); return false; } + else if (_literal.kind == assembly::LiteralKind::Number && bigint(_literal.value) > u256(-1)) + { + m_errorReporter.typeError( + _literal.location, + "Number literal too large (> 256 bits)" + ); + return false; + } m_info.stackHeightInfo[&_literal] = m_stackHeight; return true; } |