mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #8791 from random-internet-cat/fix-8406
Fix broken assertion in ContractCompiler
This commit is contained in:
commit
cc3992452f
@ -733,7 +733,10 @@ bool ContractCompiler::visit(InlineAssembly const& _inlineAssembly)
|
|||||||
{
|
{
|
||||||
case Type::Category::Bool:
|
case Type::Category::Bool:
|
||||||
case Type::Category::Address:
|
case Type::Category::Address:
|
||||||
solAssert(*type == *variable->annotation().type, "");
|
// Either both the literal and the variable are bools, or they are both addresses.
|
||||||
|
// If they are both bools, comparing category is the same as comparing the types.
|
||||||
|
// If they are both addresses, compare category so that payable/nonpayable is not compared.
|
||||||
|
solAssert(type->category() == variable->annotation().type->category(), "");
|
||||||
value = type->literalValue(literal);
|
value = type->literalValue(literal);
|
||||||
break;
|
break;
|
||||||
case Type::Category::StringLiteral:
|
case Type::Category::StringLiteral:
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
// Test for regression of https://github.com/ethereum/solidity/issues/8406
|
||||||
|
|
||||||
|
contract C {
|
||||||
|
address constant e = 0x1212121212121212121212121000002134593163;
|
||||||
|
|
||||||
|
function f() public returns (byte z) {
|
||||||
|
assembly { z := e }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----
|
||||||
|
// f() -> 0x00
|
Loading…
Reference in New Issue
Block a user