mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[yul] Adding support for accessing subobjects via .
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
This commit is contained in:
co-authored by
Kamil Śliwak
parent
952101996c
commit
6f97e6153c
@@ -26,6 +26,7 @@
|
||||
|
||||
#include <libyul/Object.h>
|
||||
#include <libyul/Exceptions.h>
|
||||
#include <libevmasm/Assembly.h>
|
||||
|
||||
using namespace solidity::yul;
|
||||
using namespace std;
|
||||
@@ -41,11 +42,12 @@ void EVMObjectCompiler::run(Object& _object, bool _optimize)
|
||||
BuiltinContext context;
|
||||
context.currentObject = &_object;
|
||||
|
||||
for (auto& subNode: _object.subObjects)
|
||||
if (Object* subObject = dynamic_cast<Object*>(subNode.get()))
|
||||
for (auto const& subNode: _object.subObjects)
|
||||
if (auto* subObject = dynamic_cast<Object*>(subNode.get()))
|
||||
{
|
||||
auto subAssemblyAndID = m_assembly.createSubAssembly();
|
||||
context.subIDs[subObject->name] = subAssemblyAndID.second;
|
||||
subObject->subId = subAssemblyAndID.second;
|
||||
compile(*subObject, *subAssemblyAndID.first, m_dialect, m_evm15, _optimize);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user