mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix mul implementation.
This commit is contained in:
parent
0966c77fa6
commit
dd777baabf
@ -191,8 +191,11 @@ smtutil::Expression ReasoningBasedSimplifier::encodeEVMBuiltin(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
case evmasm::Instruction::MUL:
|
case evmasm::Instruction::MUL:
|
||||||
// TODO this only works for multiplication by constants.
|
// TODO this only works will with the rematerializer.
|
||||||
return wrap(arguments.at(0) * arguments.at(1));
|
if (holds_alternative<Literal>(_arguments.at(0)) || holds_alternative<Literal>(_arguments.at(1)))
|
||||||
|
return wrap(arguments.at(0) * arguments.at(1));
|
||||||
|
else
|
||||||
|
return newRestrictedVariable();
|
||||||
case evmasm::Instruction::SUB:
|
case evmasm::Instruction::SUB:
|
||||||
{
|
{
|
||||||
auto result = arguments.at(0) - arguments.at(1) + (bigint(1) << 256) * newZeroOneVariable();
|
auto result = arguments.at(0) - arguments.at(1) + (bigint(1) << 256) * newZeroOneVariable();
|
||||||
|
Loading…
Reference in New Issue
Block a user