From 7763d21cc6181204b1454437b051ac56d3e89339 Mon Sep 17 00:00:00 2001 From: Leonardo Alt Date: Mon, 4 Jun 2018 12:31:18 +0200 Subject: Revert if calldata is too short or points out of bounds --- libsolidity/codegen/CompilerUtils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libsolidity/codegen/CompilerUtils.h') diff --git a/libsolidity/codegen/CompilerUtils.h b/libsolidity/codegen/CompilerUtils.h index 8e3a8a5d..0ff3ad7c 100644 --- a/libsolidity/codegen/CompilerUtils.h +++ b/libsolidity/codegen/CompilerUtils.h @@ -102,7 +102,7 @@ public: /// area. Also has a hard cap of 0x100000000 for any given length/offset field. /// Stack pre: /// Stack post: ... - void abiDecode(TypePointers const& _typeParameters, bool _fromMemory = false, bool _revertOnOutOfBounds = false); + void abiDecode(TypePointers const& _typeParameters, bool _fromMemory = false); /// Copies values (of types @a _givenTypes) given on the stack to a location in memory given /// at the stack top, encoding them according to the ABI as the given types @a _targetTypes. -- cgit v1.2.3 From 9d895e002d0e5e1e3435d03ac82277caa397bbec Mon Sep 17 00:00:00 2001 From: Leonardo Alt Date: Wed, 4 Jul 2018 14:14:41 +0200 Subject: Added tests and review suggestions --- libsolidity/codegen/CompilerUtils.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libsolidity/codegen/CompilerUtils.h') diff --git a/libsolidity/codegen/CompilerUtils.h b/libsolidity/codegen/CompilerUtils.h index 0ff3ad7c..26df4765 100644 --- a/libsolidity/codegen/CompilerUtils.h +++ b/libsolidity/codegen/CompilerUtils.h @@ -241,6 +241,10 @@ public: void popStackElement(Type const& _type); /// Removes element from the top of the stack _amount times. void popStackSlots(size_t _amount); + /// Pops slots from the stack such that its height is _toHeight. + /// Adds jump to _jumpTo. + /// Readjusts the stack offset to the original value. + void popAndJump(unsigned _toHeight, eth::AssemblyItem const& _jumpTo); template static unsigned sizeOnStack(std::vector const& _variables); -- cgit v1.2.3 From a2f03ea9e56b1ac5c2822e05bec4cad9bdf36979 Mon Sep 17 00:00:00 2001 From: Leonardo Alt Date: Mon, 23 Jul 2018 23:31:02 +0200 Subject: Fix abiDecode comment --- libsolidity/codegen/CompilerUtils.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libsolidity/codegen/CompilerUtils.h') diff --git a/libsolidity/codegen/CompilerUtils.h b/libsolidity/codegen/CompilerUtils.h index 26df4765..ad3d7327 100644 --- a/libsolidity/codegen/CompilerUtils.h +++ b/libsolidity/codegen/CompilerUtils.h @@ -97,9 +97,9 @@ public: /// Creates code that unpacks the arguments according to their types specified by a vector of TypePointers. /// From memory if @a _fromMemory is true, otherwise from call data. - /// Calls revert if @a _revertOnOutOfBounds is true and the supplied size is shorter - /// than the static data requirements or if dynamic data pointers reach outside of the - /// area. Also has a hard cap of 0x100000000 for any given length/offset field. + /// Calls revert if the supplied size is shorter than the static data requirements + /// or if dynamic data pointers reach outside of the area. + /// Also has a hard cap of 0x100000000 for any given length/offset field. /// Stack pre: /// Stack post: ... void abiDecode(TypePointers const& _typeParameters, bool _fromMemory = false); -- cgit v1.2.3 From d76bfcd935407e7249cfb8480a29da24615667cf Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 4 Oct 2018 13:03:55 +0200 Subject: Fix typos. --- libsolidity/codegen/CompilerUtils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libsolidity/codegen/CompilerUtils.h') diff --git a/libsolidity/codegen/CompilerUtils.h b/libsolidity/codegen/CompilerUtils.h index ad3d7327..bd8170ad 100644 --- a/libsolidity/codegen/CompilerUtils.h +++ b/libsolidity/codegen/CompilerUtils.h @@ -260,7 +260,7 @@ public: /// Stack post: void rightShiftNumberOnStack(unsigned _bits); - /// Appends code that computes tha Keccak-256 hash of the topmost stack element of 32 byte type. + /// Appends code that computes the Keccak-256 hash of the topmost stack element of 32 byte type. void computeHashStatic(); /// Bytes we need to the start of call data. -- cgit v1.2.3