From 28f10f4783bd4365654191740069a7112be03d92 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 28 Apr 2017 13:09:48 +0200 Subject: Remove error label / invalid jump label. --- libsolidity/codegen/CompilerUtils.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'libsolidity/codegen/CompilerUtils.h') diff --git a/libsolidity/codegen/CompilerUtils.h b/libsolidity/codegen/CompilerUtils.h index b9ed6757..4140ce8b 100644 --- a/libsolidity/codegen/CompilerUtils.h +++ b/libsolidity/codegen/CompilerUtils.h @@ -109,10 +109,6 @@ public: /// Stack post: void zeroInitialiseMemoryArray(ArrayType const& _type); - /// Uses a CALL to the identity contract to perform a memory-to-memory copy. - /// Stack pre: - /// Stack post: - void memoryCopyPrecompile(); /// Copies full 32 byte words in memory (regions cannot overlap), i.e. may copy more than length. /// Stack pre: /// Stack post: -- cgit From 0c8beac35785a3c688c48c7f607832c30509c907 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 10 May 2017 08:48:00 +0100 Subject: Rename the SHA3 assembly instruction to KECCAK256 --- 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 4140ce8b..a88951bc 100644 --- a/libsolidity/codegen/CompilerUtils.h +++ b/libsolidity/codegen/CompilerUtils.h @@ -166,7 +166,7 @@ public: static unsigned sizeOnStack(std::vector const& _variables); static unsigned sizeOnStack(std::vector> const& _variableTypes); - /// Appends code that computes tha SHA3 hash of the topmost stack element of 32 byte type. + /// Appends code that computes tha Keccak-256 hash of the topmost stack element of 32 byte type. void computeHashStatic(); /// Bytes we need to the start of call data. -- cgit From 831ed083875b73faf91f9d3335e2599540366712 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 24 May 2017 11:47:43 +0200 Subject: Change invalid opcode to revert for input validation. --- libsolidity/codegen/CompilerUtils.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'libsolidity/codegen/CompilerUtils.h') diff --git a/libsolidity/codegen/CompilerUtils.h b/libsolidity/codegen/CompilerUtils.h index a88951bc..caf2cdc2 100644 --- a/libsolidity/codegen/CompilerUtils.h +++ b/libsolidity/codegen/CompilerUtils.h @@ -135,7 +135,15 @@ public: /// If @a _cleanupNeeded, high order bits cleanup is also done if no type conversion would be /// necessary. /// If @a _chopSignBits, the function resets the signed bits out of the width of the signed integer. - void convertType(Type const& _typeOnStack, Type const& _targetType, bool _cleanupNeeded = false, bool _chopSignBits = false); + /// If @a _asPartOfArgumentDecoding is true, failed conversions are flagged via REVERT, + /// otherwise they are flagged with INVALID. + void convertType( + Type const& _typeOnStack, + Type const& _targetType, + bool _cleanupNeeded = false, + bool _chopSignBits = false, + bool _asPartOfArgumentDecoding = false + ); /// Creates a zero-value for the given type and puts it onto the stack. This might allocate /// memory for memory references. -- cgit From ab15040caa0b2b401f9bebc8d8247e8e6b6d1540 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 26 Jun 2017 16:27:12 +0200 Subject: Comment about zero length. --- libsolidity/codegen/CompilerUtils.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libsolidity/codegen/CompilerUtils.h') diff --git a/libsolidity/codegen/CompilerUtils.h b/libsolidity/codegen/CompilerUtils.h index caf2cdc2..0ee053a9 100644 --- a/libsolidity/codegen/CompilerUtils.h +++ b/libsolidity/codegen/CompilerUtils.h @@ -110,10 +110,12 @@ public: void zeroInitialiseMemoryArray(ArrayType const& _type); /// Copies full 32 byte words in memory (regions cannot overlap), i.e. may copy more than length. + /// Length can be zero, in this case, it copies nothing. /// Stack pre: /// Stack post: void memoryCopy32(); /// Copies data in memory (regions cannot overlap). + /// Length can be zero, in this case, it copies nothing. /// Stack pre: /// Stack post: void memoryCopy(); -- cgit From 0494fa98c0c973bf9e8b3dfa4873e1b5744e7715 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Mon, 21 Nov 2016 12:23:43 +0000 Subject: Add shift helper to CompilerUtils --- libsolidity/codegen/CompilerUtils.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libsolidity/codegen/CompilerUtils.h') diff --git a/libsolidity/codegen/CompilerUtils.h b/libsolidity/codegen/CompilerUtils.h index 0ee053a9..278f9302 100644 --- a/libsolidity/codegen/CompilerUtils.h +++ b/libsolidity/codegen/CompilerUtils.h @@ -176,6 +176,12 @@ public: static unsigned sizeOnStack(std::vector const& _variables); static unsigned sizeOnStack(std::vector> const& _variableTypes); + /// Helper function to shift top value on the stack to the left. + void leftShiftNumberOnStack(u256 _shiftFactor); + + /// Helper function to shift top value on the stack to the right. + void rightShiftNumberOnStack(u256 _shiftFactor, bool _isSigned = false); + /// Appends code that computes tha Keccak-256 hash of the topmost stack element of 32 byte type. void computeHashStatic(); -- cgit From 8fd1d4167d2d05363ecf6af7ada42da940199900 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 30 Nov 2016 10:03:26 +0000 Subject: Change shiftNumberOnStack to bits --- libsolidity/codegen/CompilerUtils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libsolidity/codegen/CompilerUtils.h') diff --git a/libsolidity/codegen/CompilerUtils.h b/libsolidity/codegen/CompilerUtils.h index 278f9302..fb169463 100644 --- a/libsolidity/codegen/CompilerUtils.h +++ b/libsolidity/codegen/CompilerUtils.h @@ -177,10 +177,10 @@ public: static unsigned sizeOnStack(std::vector> const& _variableTypes); /// Helper function to shift top value on the stack to the left. - void leftShiftNumberOnStack(u256 _shiftFactor); + void leftShiftNumberOnStack(unsigned _bits); /// Helper function to shift top value on the stack to the right. - void rightShiftNumberOnStack(u256 _shiftFactor, bool _isSigned = false); + void rightShiftNumberOnStack(unsigned _bits, bool _isSigned = false); /// Appends code that computes tha Keccak-256 hash of the topmost stack element of 32 byte type. void computeHashStatic(); -- cgit