mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Optimize RETURN x 0 to STOP.
This commit is contained in:
parent
c3caa2ce25
commit
d60ef3f2d7
@ -298,7 +298,10 @@ void Compiler::appendReturnValuePacker(TypePointers const& _typeParameters)
|
||||
stackDepth -= type->getSizeOnStack();
|
||||
}
|
||||
// note that the stack is not cleaned up here
|
||||
m_context << u256(dataOffset) << u256(0) << eth::Instruction::RETURN;
|
||||
if (dataOffset == 0)
|
||||
m_context << eth::Instruction::STOP;
|
||||
else
|
||||
m_context << u256(dataOffset) << u256(0) << eth::Instruction::RETURN;
|
||||
}
|
||||
|
||||
void Compiler::registerStateVariables(ContractDefinition const& _contract)
|
||||
|
Loading…
Reference in New Issue
Block a user