Merge pull request #10335 from ethereum/fixMappingConversion

[Sol->Yul] Fix mapping conversion.
This commit is contained in:
chriseth 2020-11-19 12:30:17 +01:00 committed by GitHub
commit 4abfe36102
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -3072,6 +3072,12 @@ string YulUtilFunctions::conversionFunction(Type const& _from, Type const& _to)
solAssert(false, "Invalid conversion from " + _from.canonicalName() + " to " + _to.canonicalName());
break;
}
case Type::Category::Mapping:
{
solAssert(_from == _to, "");
body = "converted := value";
break;
}
default:
solAssert(false, "Invalid conversion from " + _from.canonicalName() + " to " + _to.canonicalName());
}

View File

@ -12,5 +12,7 @@ contract test {
return (m1[1], m1[2], m2[1], m2[2]);
}
}
// ====
// compileViaYul: also
// ----
// f() -> 42, 0, 0, 21