From e9dcfb0b624e5443942451fc865c154a2c5a73d7 Mon Sep 17 00:00:00 2001 From: bitshift Date: Fri, 9 Mar 2018 17:46:24 +0100 Subject: Implements pop() for value type arrays. --- libsolidity/codegen/ArrayUtils.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libsolidity/codegen/ArrayUtils.h') diff --git a/libsolidity/codegen/ArrayUtils.h b/libsolidity/codegen/ArrayUtils.h index 99786397..84d591d7 100644 --- a/libsolidity/codegen/ArrayUtils.h +++ b/libsolidity/codegen/ArrayUtils.h @@ -73,6 +73,11 @@ public: /// Stack pre: reference (excludes byte offset) /// Stack post: new_length void incrementDynamicArraySize(ArrayType const& _type) const; + /// Decrements the size of a dynamic array by one if length is nonzero. Returns otherwise. + /// Clears the removed data element. In case of a byte array, this might move the data. + /// Stack pre: reference + /// Stack post: + void popStorageArrayElement(ArrayType const& _type) const; /// Appends a loop that clears a sequence of storage slots of the given type (excluding end). /// Stack pre: end_ref start_ref /// Stack post: end_ref -- cgit v1.2.3 From 98d52beba3f989b3a5eeaba2d257de8de5df60a7 Mon Sep 17 00:00:00 2001 From: Erik Kundt Date: Wed, 16 May 2018 17:18:30 +0200 Subject: Adds syntax tests, documentation and changelog entry. Refines comment for array utility function. --- libsolidity/codegen/ArrayUtils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libsolidity/codegen/ArrayUtils.h') diff --git a/libsolidity/codegen/ArrayUtils.h b/libsolidity/codegen/ArrayUtils.h index 84d591d7..daf50bf5 100644 --- a/libsolidity/codegen/ArrayUtils.h +++ b/libsolidity/codegen/ArrayUtils.h @@ -73,7 +73,7 @@ public: /// Stack pre: reference (excludes byte offset) /// Stack post: new_length void incrementDynamicArraySize(ArrayType const& _type) const; - /// Decrements the size of a dynamic array by one if length is nonzero. Returns otherwise. + /// Decrements the size of a dynamic array by one if length is nonzero. Causes an invalid instruction otherwise. /// Clears the removed data element. In case of a byte array, this might move the data. /// Stack pre: reference /// Stack post: -- cgit v1.2.3