Created
June 20, 2019 11:21
-
-
Save Marenz/03916b715399db701556ec68d466df34 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yul::Expression operator()(yul::Identifier const& _identifier) override | |
{ | |
auto const& reference = m_references.at(&_identifier); | |
auto const varDecl = dynamic_cast<VariableDeclaration const*>(reference.declaration); | |
solUnimplementedAssert(varDecl, ""); | |
if (reference.isOffset || reference.isSlot) | |
{ | |
solAssert(reference.isOffset != reference.isSlot, ""); | |
pair<u256, unsigned> slot_offset = m_context.storageLocationOfVariable(*varDecl); | |
string const value = reference.isSlot ? | |
slot_offset.first.str() : | |
to_string(slot_offset.second); | |
return yul::Literal{ | |
_identifier.location, | |
yul::LiteralKind::Number, | |
yul::YulString{value}, | |
yul::YulString{"uint256"} | |
}; | |
} | |
else | |
return ASTCopier::operator()(_identifier); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment