diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-09-26 22:39:53 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-11-13 20:47:29 +0800 |
commit | e82917d4e6428fdfc86f10ce63846aea65852540 (patch) | |
tree | 9abe556ce93e42a5026428e2f707bdc62ca15e32 | |
parent | a4d2e17a045a5b9ca50b8340242ce40a6be73ec9 (diff) | |
download | dexon-solidity-e82917d4e6428fdfc86f10ce63846aea65852540.tar.gz dexon-solidity-e82917d4e6428fdfc86f10ce63846aea65852540.tar.zst dexon-solidity-e82917d4e6428fdfc86f10ce63846aea65852540.zip |
Add LLL error when assembly instruction causes stack underflow
-rw-r--r-- | liblll/CodeFragment.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/liblll/CodeFragment.cpp b/liblll/CodeFragment.cpp index 60dd0917..f37cb8b9 100644 --- a/liblll/CodeFragment.cpp +++ b/liblll/CodeFragment.cpp @@ -236,7 +236,12 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s) int c = 0; for (auto const& i: _t) if (c++) - m_asm.append(CodeFragment(i, _s, m_readFile, true).m_asm); + { + auto fragment = CodeFragment(i, _s, m_readFile, true).m_asm; + if ((m_asm.deposit() + fragment.deposit()) < 0) + error<IncorrectParameterCount>("The assembly instruction resulted in stack underflow"); + m_asm.append(fragment); + } } else if (us == "INCLUDE") { |