From 0201492bbfb18ecc73f34d10e76dc0ee8395de73 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Fri, 13 Apr 2018 02:14:18 +0100 Subject: Remove redundant cleanup for abi.encode. --- libsolidity/codegen/ExpressionCompiler.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index ed5af42e..3cf46a9d 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -1023,7 +1023,6 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall) solAssert(function.kind() == FunctionType::Kind::ABIEncodeWithSelector, ""); } - // Cleanup actually does not clean on shrinking the type. utils().convertType(*dataOnStack, FixedBytesType(4), true); // stack: @@ -1034,7 +1033,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall) let data_start := add(mem_ptr, 0x20) let data := mload(data_start) let mask := )" + mask + R"( - mstore(data_start, or(and(data, mask), and(selector, not(mask)))) + mstore(data_start, or(and(data, mask), selector)) })", {"mem_ptr", "selector"}); m_context << Instruction::POP; } -- cgit v1.2.3