mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Makes array length access read-only.
This commit is contained in:
@@ -171,31 +171,6 @@ public:
|
||||
) const override;
|
||||
};
|
||||
|
||||
/**
|
||||
* Reference to the "length" member of a dynamically-sized array. This is an LValue with special
|
||||
* semantics since assignments to it might reduce its length and thus arrays members have to be
|
||||
* deleted.
|
||||
*/
|
||||
class StorageArrayLength: public LValue
|
||||
{
|
||||
public:
|
||||
/// Constructs the LValue, assumes that the reference to the array head is already on the stack.
|
||||
StorageArrayLength(CompilerContext& _compilerContext, ArrayType const& _arrayType);
|
||||
void retrieveValue(langutil::SourceLocation const& _location, bool _remove = false) const override;
|
||||
virtual void storeValue(
|
||||
Type const& _sourceType,
|
||||
langutil::SourceLocation const& _location = {},
|
||||
bool _move = false
|
||||
) const override;
|
||||
virtual void setToZero(
|
||||
langutil::SourceLocation const& _location = {},
|
||||
bool _removeReference = true
|
||||
) const override;
|
||||
|
||||
private:
|
||||
ArrayType const& m_arrayType;
|
||||
};
|
||||
|
||||
/**
|
||||
* Tuple object that can itself hold several LValues.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user