aboutsummaryrefslogtreecommitdiffstats
path: root/ExpressionCompiler.h
diff options
context:
space:
mode:
authorliana <liana@ethdev.com>2015-01-14 20:52:03 +0800
committerliana <liana@ethdev.com>2015-01-15 18:59:58 +0800
commit00b0b0933de8f745451652e8838f0c09a741228e (patch)
tree793020607eeba7ede1ed0356a215385dd5bf13e0 /ExpressionCompiler.h
parent6e16107870494878635da347146b076a7d75dea0 (diff)
downloaddexon-solidity-00b0b0933de8f745451652e8838f0c09a741228e.tar.gz
dexon-solidity-00b0b0933de8f745451652e8838f0c09a741228e.tar.zst
dexon-solidity-00b0b0933de8f745451652e8838f0c09a741228e.zip
- added functionality to set values to 0 when deleting structure(not for mapping)
- added unit test Made some changes after Christian`s review on pull request - remove/edit comments - BoolType and ContractType return VoidType after delete - fixed constructor_arguments test - fixed set to 0 when deleting variable from stack - changed test case to test that
Diffstat (limited to 'ExpressionCompiler.h')
-rw-r--r--ExpressionCompiler.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/ExpressionCompiler.h b/ExpressionCompiler.h
index 98f58c85..665ee3c9 100644
--- a/ExpressionCompiler.h
+++ b/ExpressionCompiler.h
@@ -119,7 +119,7 @@ private:
/// Set type according to the declaration and retrieve the reference.
/// @a _expression is the current expression
void fromIdentifier(Identifier const& _identifier, Declaration const& _declaration);
- void reset() { m_type = NONE; m_baseStackOffset = 0; }
+ void reset() { m_type = NONE; m_baseStackOffset = 0; m_size = 0; }
bool isValid() const { return m_type != NONE; }
bool isInOnStack() const { return m_type == STACK; }
@@ -138,7 +138,9 @@ private:
/// Also removes the stored value from the stack if @a _move is
/// true. @a _expression is the current expression, used for error reporting.
void storeValue(Expression const& _expression, bool _move = false) const;
-
+ /// Stores zero in the lvalue.
+ /// @a _expression is the current expression, used for error reporting.
+ void setToZero(Expression const& _expression) const;
/// Convenience function to convert the stored reference to a value and reset type to NONE if
/// the reference was not requested by @a _expression.
void retrieveValueIfLValueNotRequested(Expression const& _expression);
@@ -149,8 +151,8 @@ private:
/// If m_type is STACK, this is base stack offset (@see
/// CompilerContext::getBaseStackOffsetOfVariable) of a local variable.
unsigned m_baseStackOffset = 0;
- /// Size of the value of this lvalue on the stack.
- unsigned m_stackSize = 0;
+ /// Size of the value of this lvalue on the stack or the storage.
+ unsigned m_size = 0;
};
bool m_optimize;