aboutsummaryrefslogtreecommitdiffstats
path: root/liblll/CodeFragment.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'liblll/CodeFragment.cpp')
-rw-r--r--liblll/CodeFragment.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/liblll/CodeFragment.cpp b/liblll/CodeFragment.cpp
index f37cb8b9..c6ab86f5 100644
--- a/liblll/CodeFragment.cpp
+++ b/liblll/CodeFragment.cpp
@@ -259,6 +259,7 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s)
}
else if (us == "SET")
{
+ // TODO: move this to be a stack variable (and not a memory variable)
if (_t.size() != 3)
error<IncorrectParameterCount>(us);
int c = 0;
@@ -268,6 +269,15 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s)
m_asm.append((u256)varAddress(firstAsString(), true));
m_asm.append(Instruction::MSTORE);
}
+ else if (us == "UNSET")
+ {
+ // TODO: this doesn't actually free up anything, since it is a memory variable (see "SET")
+ if (_t.size() != 2)
+ error<IncorrectParameterCount>();
+ auto it = _s.vars.find(firstAsString());
+ if (it != _s.vars.end())
+ _s.vars.erase(it);
+ }
else if (us == "GET")
{
if (_t.size() != 2)