mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #10410 from ethereum/ir-fixedbytes-bitnot
Support BitNot on FixedBytes in IR
This commit is contained in:
@@ -693,10 +693,16 @@ void IRGeneratorForStatements::endVisit(UnaryOperation const& _unaryOperation)
|
||||
else
|
||||
solUnimplementedAssert(false, "Unary operator not yet implemented");
|
||||
}
|
||||
else if (resultType.category() == Type::Category::FixedBytes)
|
||||
{
|
||||
solAssert(op == Token::BitNot, "Only bitwise negation is allowed for FixedBytes");
|
||||
solAssert(resultType == type(_unaryOperation.subExpression()), "Result type doesn't match!");
|
||||
appendSimpleUnaryOperation(_unaryOperation, _unaryOperation.subExpression());
|
||||
}
|
||||
else if (resultType.category() == Type::Category::Bool)
|
||||
{
|
||||
solAssert(
|
||||
_unaryOperation.getOperator() != Token::BitNot,
|
||||
op != Token::BitNot,
|
||||
"Bitwise Negation can't be done on bool!"
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user