Add LLL error when assembly instruction causes stack underflow

This commit is contained in:
Alex Beregszaszi 2018-09-26 15:39:53 +01:00 committed by chriseth
parent a4d2e17a04
commit e82917d4e6

View File

@ -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")
{