mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove redundant cleanup for abi.encode.
This commit is contained in:
parent
4c1d39b7a2
commit
0201492bbf
@ -1023,7 +1023,6 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
|
|||||||
solAssert(function.kind() == FunctionType::Kind::ABIEncodeWithSelector, "");
|
solAssert(function.kind() == FunctionType::Kind::ABIEncodeWithSelector, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cleanup actually does not clean on shrinking the type.
|
|
||||||
utils().convertType(*dataOnStack, FixedBytesType(4), true);
|
utils().convertType(*dataOnStack, FixedBytesType(4), true);
|
||||||
|
|
||||||
// stack: <memory pointer> <selector>
|
// stack: <memory pointer> <selector>
|
||||||
@ -1034,7 +1033,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
|
|||||||
let data_start := add(mem_ptr, 0x20)
|
let data_start := add(mem_ptr, 0x20)
|
||||||
let data := mload(data_start)
|
let data := mload(data_start)
|
||||||
let mask := )" + mask + R"(
|
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"});
|
})", {"mem_ptr", "selector"});
|
||||||
m_context << Instruction::POP;
|
m_context << Instruction::POP;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user