aboutsummaryrefslogtreecommitdiffstats
path: root/liblll
diff options
context:
space:
mode:
Diffstat (limited to 'liblll')
-rw-r--r--liblll/CodeFragment.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/liblll/CodeFragment.cpp b/liblll/CodeFragment.cpp
index 0f7f48ba..47ddc4a6 100644
--- a/liblll/CodeFragment.cpp
+++ b/liblll/CodeFragment.cpp
@@ -571,7 +571,9 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s)
{
for (auto const& i: code)
m_asm.append(i.m_asm);
- m_asm.popTo(1);
+ // Leave only the last item on stack.
+ while (m_asm.deposit() > 1)
+ m_asm.append(Instruction::POP);
}
else if (us == "BYTECODESIZE")
{