mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[yul-phaser] Make Program copyable by doing a deep copy of the AST in the copy constructor
This commit is contained in:
@@ -57,6 +57,13 @@ ostream& operator<<(ostream& _stream, Program const& _program);
|
||||
|
||||
}
|
||||
|
||||
Program::Program(Program const& program):
|
||||
m_ast(make_unique<Block>(get<Block>(ASTCopier{}(*program.m_ast)))),
|
||||
m_dialect{program.m_dialect},
|
||||
m_nameDispenser(program.m_nameDispenser)
|
||||
{
|
||||
}
|
||||
|
||||
Program Program::load(CharStream& _sourceCode)
|
||||
{
|
||||
// ASSUMPTION: parseSource() rewinds the stream on its own
|
||||
|
||||
Reference in New Issue
Block a user