Remove redundant cleanup for abi.encode.

This commit is contained in:
Alex Beregszaszi 2018-04-13 02:14:18 +01:00 committed by chriseth
parent 4c1d39b7a2
commit 0201492bbf

View File

@ -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: <memory pointer> <selector>
@ -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;
}