Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of EOF in Solidity #15294

Draft
wants to merge 15 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions libevmasm/Assembly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ std::pair<std::shared_ptr<Assembly>, std::vector<std::string>> Assembly::fromJSO
"Member 'sourceList' may only be present in the root JSON object."
);

auto result = std::make_shared<Assembly>(EVMVersion{}, _level == 0 /* _creation */, "" /* _name */);
auto result = std::make_shared<Assembly>(EVMVersion{}, _level == 0 /* _creation */, std::nullopt, "" /* _name */);
std::vector<std::string> parsedSourceList;
if (_json.contains("sourceList"))
{
Expand Down Expand Up @@ -735,7 +735,7 @@ std::map<u256, u256> const& Assembly::optimiseInternal(
{
count = 0;

if (_settings.runInliner)
if (_settings.runInliner && !m_eofVersion.has_value())
Inliner{
m_items,
_tagsReferencedFromOutside,
Expand All @@ -762,7 +762,7 @@ std::map<u256, u256> const& Assembly::optimiseInternal(
}

// This only modifies PushTags, we have to run again to actually remove code.
if (_settings.runDeduplicate)
if (_settings.runDeduplicate && !m_eofVersion.has_value())
{
BlockDeduplicator deduplicator{m_items};
if (deduplicator.deduplicate())
Expand All @@ -787,7 +787,8 @@ std::map<u256, u256> const& Assembly::optimiseInternal(
}
}

if (_settings.runCSE)
// TODO: investigate for EOF
if (_settings.runCSE && !m_eofVersion.has_value())
{
// Control flow graph optimization has been here before but is disabled because it
// assumes we only jump to tags that are pushed. This is not the case anymore with
Expand Down Expand Up @@ -839,7 +840,8 @@ std::map<u256, u256> const& Assembly::optimiseInternal(
}
}

if (_settings.runConstantOptimiser)
// TODO: investigate for EOF
if (_settings.runConstantOptimiser && !m_eofVersion.has_value())
ConstantOptimisationMethod::optimiseConstants(
isCreation(),
isCreation() ? 1 : _settings.expectedExecutionsPerDeployment,
Expand All @@ -862,6 +864,8 @@ LinkerObject const& Assembly::assemble() const

LinkerObject& ret = m_assembledObject;

bool const eof = m_eofVersion.has_value();

size_t subTagSize = 1;
std::map<u256, std::pair<std::string, std::vector<size_t>>> immutableReferencesBySub;
for (auto const& sub: m_subs)
Expand Down Expand Up @@ -957,6 +961,7 @@ LinkerObject const& Assembly::assemble() const
}
case PushTag:
{
assertThrow(!eof, AssemblyException, "PushTag in EOF code");
ret.bytecode.push_back(tagPush);
tagRef[ret.bytecode.size()] = i.splitForeignPushTag();
ret.bytecode.resize(ret.bytecode.size() + bytesPerTag);
Expand All @@ -968,13 +973,15 @@ LinkerObject const& Assembly::assemble() const
ret.bytecode.resize(ret.bytecode.size() + bytesPerDataRef);
break;
case PushSub:
assertThrow(!eof, AssemblyException, "PushSub in EOF code");
assertThrow(i.data() <= std::numeric_limits<size_t>::max(), AssemblyException, "");
ret.bytecode.push_back(dataRefPush);
subRef.insert(std::make_pair(static_cast<size_t>(i.data()), ret.bytecode.size()));
ret.bytecode.resize(ret.bytecode.size() + bytesPerDataRef);
break;
case PushSubSize:
{
assertThrow(!eof, AssemblyException, "PushSubSize in EOF code");
assertThrow(i.data() <= std::numeric_limits<size_t>::max(), AssemblyException, "");
auto s = subAssemblyById(static_cast<size_t>(i.data()))->assemble().bytecode.size();
i.setPushedValue(u256(s));
Expand All @@ -987,6 +994,7 @@ LinkerObject const& Assembly::assemble() const
}
case PushProgramSize:
{
assertThrow(!eof, AssemblyException, "PushProgramSize in EOF code");
ret.bytecode.push_back(dataRefPush);
sizeRef.push_back(static_cast<unsigned>(ret.bytecode.size()));
ret.bytecode.resize(ret.bytecode.size() + bytesPerDataRef);
Expand All @@ -998,6 +1006,7 @@ LinkerObject const& Assembly::assemble() const
ret.bytecode.resize(ret.bytecode.size() + 20);
break;
case PushImmutable:
assertThrow(!eof, AssemblyException, "PushImmutable in EOF code");
ret.bytecode.push_back(static_cast<uint8_t>(Instruction::PUSH32));
// Maps keccak back to the "identifier" std::string of that immutable.
ret.immutableReferences[i.data()].first = m_immutables.at(i.data());
Expand All @@ -1011,6 +1020,7 @@ LinkerObject const& Assembly::assemble() const
break;
case AssignImmutable:
{
assertThrow(!eof, AssemblyException, "AssignImmutable in EOF code");
// Expect 2 elements on stack (source, dest_base)
auto const& offsets = immutableReferencesBySub[i.data()].second;
for (size_t i = 0; i < offsets.size(); ++i)
Expand Down Expand Up @@ -1063,7 +1073,7 @@ LinkerObject const& Assembly::assemble() const
"Some immutables were read from but never assigned, possibly because of optimization."
);

if (!m_subs.empty() || !m_data.empty() || !m_auxiliaryData.empty())
if (!eof && (!m_subs.empty() || !m_data.empty() || !m_auxiliaryData.empty()))
// Append an INVALID here to help tests find miscompilation.
ret.bytecode.push_back(static_cast<uint8_t>(Instruction::INVALID));

Expand Down
11 changes: 9 additions & 2 deletions libevmasm/Assembly.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,14 @@ using AssemblyPointer = std::shared_ptr<Assembly>;
class Assembly
{
public:
Assembly(langutil::EVMVersion _evmVersion, bool _creation, std::string _name): m_evmVersion(_evmVersion), m_creation(_creation), m_name(std::move(_name)) { }

Assembly(langutil::EVMVersion _evmVersion, bool _creation, std::optional<uint8_t> _eofVersion, std::string _name):
m_evmVersion(_evmVersion),
m_creation(_creation),
m_eofVersion(_eofVersion),
m_name(std::move(_name))
{}

std::optional<uint8_t> eofVersion() const { return m_eofVersion; }
AssemblyItem newTag() { assertThrow(m_usedTags < 0xffffffff, AssemblyException, ""); return AssemblyItem(Tag, m_usedTags++); }
AssemblyItem newPushTag() { assertThrow(m_usedTags < 0xffffffff, AssemblyException, ""); return AssemblyItem(PushTag, m_usedTags++); }
/// Returns a tag identified by the given name. Creates it if it does not yet exist.
Expand Down Expand Up @@ -242,6 +248,7 @@ class Assembly
int m_deposit = 0;
/// True, if the assembly contains contract creation code.
bool const m_creation = false;
std::optional<uint8_t> m_eofVersion;
/// Internal name of the assembly object, only used with the Yul backend
/// currently
std::string m_name;
Expand Down
6 changes: 3 additions & 3 deletions libsolidity/codegen/Compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ namespace solidity::frontend
class Compiler
{
public:
Compiler(langutil::EVMVersion _evmVersion, RevertStrings _revertStrings, OptimiserSettings _optimiserSettings):
Compiler(langutil::EVMVersion _evmVersion, std::optional<uint8_t> _eofVersion, RevertStrings _revertStrings, OptimiserSettings _optimiserSettings):
m_optimiserSettings(std::move(_optimiserSettings)),
m_runtimeContext(_evmVersion, _revertStrings),
m_context(_evmVersion, _revertStrings, &m_runtimeContext)
m_runtimeContext(_evmVersion, _eofVersion, _revertStrings),
m_context(_evmVersion, _eofVersion, _revertStrings, &m_runtimeContext)
{ }

/// Compiles a contract.
Expand Down
3 changes: 2 additions & 1 deletion libsolidity/codegen/CompilerContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ class CompilerContext
public:
explicit CompilerContext(
langutil::EVMVersion _evmVersion,
std::optional<uint8_t> _eofVersion,
RevertStrings _revertStrings,
CompilerContext* _runtimeContext = nullptr
):
m_asm(std::make_shared<evmasm::Assembly>(_evmVersion, _runtimeContext != nullptr, std::string{})),
m_asm(std::make_shared<evmasm::Assembly>(_evmVersion, _runtimeContext != nullptr, _eofVersion, std::string{})),
m_evmVersion(_evmVersion),
m_revertStrings(_revertStrings),
m_reservedMemory{0},
Expand Down
10 changes: 9 additions & 1 deletion libsolidity/interface/CompilerStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,10 @@ std::string const* CompilerStack::sourceMapping(std::string const& _contractName
{
solAssert(m_stackState == CompilationSuccessful, "Compilation was not successful.");

// TODO
if (m_eofVersion.has_value())
return nullptr;

Contract const& c = contract(_contractName);
if (!c.sourceMapping)
{
Expand All @@ -876,6 +880,10 @@ std::string const* CompilerStack::runtimeSourceMapping(std::string const& _contr
{
solAssert(m_stackState == CompilationSuccessful, "Compilation was not successful.");

// TODO
if (m_eofVersion.has_value())
return nullptr;

Contract const& c = contract(_contractName);
if (!c.runtimeSourceMapping)
{
Expand Down Expand Up @@ -1412,7 +1420,7 @@ void CompilerStack::compileContract(

Contract& compiledContract = m_contracts.at(_contract.fullyQualifiedName());

std::shared_ptr<Compiler> compiler = std::make_shared<Compiler>(m_evmVersion, m_revertStrings, m_optimiserSettings);
std::shared_ptr<Compiler> compiler = std::make_shared<Compiler>(m_evmVersion, m_eofVersion, m_revertStrings, m_optimiserSettings);
Copy link
Member

@ekpyron ekpyron Aug 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of passing m_eofVersion around here, we can just assert

solUnimplementedAssert(!m_eofVersion, "EOF is not supported for legacy code generation");

(this is only-legacy, see the solAssert(!m_viaIR, ""); below)
And thereby leave libsolidity/codegen/Compiler.h and libsolidity/codegen/CompilerContext.h largely untouched (resp. where they need an eof version just use std::nullopt directly).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compiledContract.compiler = compiler;

solAssert(!m_viaIR, "");
Expand Down
5 changes: 3 additions & 2 deletions libsolidity/interface/StandardCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ std::optional<Json> checkAuxiliaryInputKeys(Json const& _input)

std::optional<Json> checkSettingsKeys(Json const& _input)
{
static std::set<std::string> keys{"debug", "evmVersion", "libraries", "metadata", "modelChecker", "optimizer", "outputSelection", "remappings", "stopAfter", "viaIR"};
static std::set<std::string> keys{"debug", "evmVersion", "eofVersion", "libraries", "metadata", "modelChecker", "optimizer", "outputSelection", "remappings", "stopAfter", "viaIR"};
return checkKeys(_input, keys, "settings");
}

Expand Down Expand Up @@ -837,7 +837,7 @@ std::variant<StandardCompiler::InputsAndSettings, Json> StandardCompiler::parseI
{
if (!settings["eofVersion"].is_number_unsigned())
return formatFatalError(Error::Type::JSONError, "eofVersion must be an unsigned integer.");
auto eofVersion = settings["evmVersion"].get<uint8_t>();
auto eofVersion = settings["eofVersion"].get<uint8_t>();
Copy link
Member

@ekpyron ekpyron Aug 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the related evm-version check change can and should separately go into develop :-).
EDIT: as per chat, let's just merge the first three commits for now :-).

if (eofVersion != 1)
return formatFatalError(Error::Type::JSONError, "Invalid EOF version requested.");
ret.eofVersion = 1;
Expand Down Expand Up @@ -1308,6 +1308,7 @@ Json StandardCompiler::compileSolidity(StandardCompiler::InputsAndSettings _inpu
compilerStack.addSMTLib2Response(smtLib2Response.first, smtLib2Response.second);
compilerStack.setViaIR(_inputsAndSettings.viaIR);
compilerStack.setEVMVersion(_inputsAndSettings.evmVersion);
compilerStack.setEOFVersion(_inputsAndSettings.eofVersion);
compilerStack.setRemappings(std::move(_inputsAndSettings.remappings));
compilerStack.setOptimiserSettings(std::move(_inputsAndSettings.optimiserSettings));
compilerStack.setRevertStringBehaviour(_inputsAndSettings.revertStrings);
Expand Down
2 changes: 1 addition & 1 deletion libyul/YulStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ YulStack::assembleEVMWithDeployed(std::optional<std::string_view> _deployName)
yulAssert(m_parserResult->hasCode(), "");
yulAssert(m_parserResult->analysisInfo, "");

evmasm::Assembly assembly(m_evmVersion, true, {});
evmasm::Assembly assembly(m_evmVersion, true, m_eofVersion, {});
EthAssemblyAdapter adapter(assembly);

// NOTE: We always need stack optimization when Yul optimizer is disabled (unless code contains
Expand Down
2 changes: 1 addition & 1 deletion libyul/backends/evm/AbstractAssembly.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class AbstractAssembly
/// Append the assembled size as a constant.
virtual void appendAssemblySize() = 0;
/// Creates a new sub-assembly, which can be referenced using dataSize and dataOffset.
virtual std::pair<std::shared_ptr<AbstractAssembly>, SubID> createSubAssembly(bool _creation, std::string _name = "") = 0;
virtual std::pair<std::shared_ptr<AbstractAssembly>, SubID> createSubAssembly(bool _creation, std::optional<uint8_t> _eofVersion, std::string _name = "") = 0;
/// Appends the offset of the given sub-assembly or data.
virtual void appendDataOffset(std::vector<SubID> const& _subPath) = 0;
/// Appends the size of the given sub-assembly or data.
Expand Down
4 changes: 2 additions & 2 deletions libyul/backends/evm/EVMObjectCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void EVMObjectCompiler::run(Object& _object, bool _optimize)
if (auto* subObject = dynamic_cast<Object*>(subNode.get()))
{
bool isCreation = !boost::ends_with(subObject->name, "_deployed");
auto subAssemblyAndID = m_assembly.createSubAssembly(isCreation, subObject->name);
auto subAssemblyAndID = m_assembly.createSubAssembly(isCreation, m_eofVersion, subObject->name);
context.subIDs[subObject->name] = subAssemblyAndID.second;
subObject->subId = subAssemblyAndID.second;
compile(*subObject, *subAssemblyAndID.first, m_dialect, _optimize, m_eofVersion);
Expand All @@ -75,7 +75,7 @@ void EVMObjectCompiler::run(Object& _object, bool _optimize)
yulAssert(_object.hasCode(), "No code.");
if (m_eofVersion.has_value())
yulAssert(
_optimize && (m_dialect.evmVersion() == langutil::EVMVersion()),
_optimize && (m_dialect.evmVersion() >= langutil::EVMVersion::prague()),
"Experimental EOF support is only available for optimized via-IR compilation and the most recent EVM version."
);
if (_optimize && m_dialect.evmVersion().canOverchargeGasForCall())
Expand Down
4 changes: 2 additions & 2 deletions libyul/backends/evm/EthAssemblyAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ void EthAssemblyAdapter::appendAssemblySize()
m_assembly.appendProgramSize();
}

std::pair<std::shared_ptr<AbstractAssembly>, AbstractAssembly::SubID> EthAssemblyAdapter::createSubAssembly(bool _creation, std::string _name)
std::pair<std::shared_ptr<AbstractAssembly>, AbstractAssembly::SubID> EthAssemblyAdapter::createSubAssembly(bool _creation, std::optional<uint8_t> _eofVersion, std::string _name)
{
std::shared_ptr<evmasm::Assembly> assembly{std::make_shared<evmasm::Assembly>(m_assembly.evmVersion(), _creation, std::move(_name))};
std::shared_ptr<evmasm::Assembly> assembly{std::make_shared<evmasm::Assembly>(m_assembly.evmVersion(), _creation, _eofVersion, std::move(_name))};
auto sub = m_assembly.newSub(assembly);
return {std::make_shared<EthAssemblyAdapter>(*assembly), static_cast<size_t>(sub.data())};
}
Expand Down
2 changes: 1 addition & 1 deletion libyul/backends/evm/EthAssemblyAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class EthAssemblyAdapter: public AbstractAssembly
void appendJumpTo(LabelID _labelId, int _stackDiffAfter, JumpType _jumpType) override;
void appendJumpToIf(LabelID _labelId, JumpType _jumpType) override;
void appendAssemblySize() override;
std::pair<std::shared_ptr<AbstractAssembly>, SubID> createSubAssembly(bool _creation, std::string _name = {}) override;
std::pair<std::shared_ptr<AbstractAssembly>, SubID> createSubAssembly(bool _creation, std::optional<uint8_t> _eofVersion, std::string _name = {}) override;
void appendDataOffset(std::vector<SubID> const& _subPath) override;
void appendDataSize(std::vector<SubID> const& _subPath) override;
SubID appendData(bytes const& _data) override;
Expand Down
2 changes: 1 addition & 1 deletion libyul/backends/evm/NoOutputAssembly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void NoOutputAssembly::appendAssemblySize()
appendInstruction(evmasm::Instruction::PUSH1);
}

std::pair<std::shared_ptr<AbstractAssembly>, AbstractAssembly::SubID> NoOutputAssembly::createSubAssembly(bool, std::string)
std::pair<std::shared_ptr<AbstractAssembly>, AbstractAssembly::SubID> NoOutputAssembly::createSubAssembly(bool, std::optional<uint8_t>, std::string)
{
yulAssert(false, "Sub assemblies not implemented.");
return {};
Expand Down
2 changes: 1 addition & 1 deletion libyul/backends/evm/NoOutputAssembly.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class NoOutputAssembly: public AbstractAssembly
void appendJumpToIf(LabelID _labelId, JumpType _jumpType) override;

void appendAssemblySize() override;
std::pair<std::shared_ptr<AbstractAssembly>, SubID> createSubAssembly(bool _creation, std::string _name = "") override;
std::pair<std::shared_ptr<AbstractAssembly>, SubID> createSubAssembly(bool _creation, std::optional<uint8_t> _eofVersion, std::string _name = "") override;
void appendDataOffset(std::vector<SubID> const& _subPath) override;
void appendDataSize(std::vector<SubID> const& _subPath) override;
SubID appendData(bytes const& _data) override;
Expand Down
21 changes: 11 additions & 10 deletions test/libevmasm/Assembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <libevmasm/Disassemble.h>
#include <libyul/Exceptions.h>

#include <test/Common.h>
#include <boost/test/unit_test.hpp>

#include <algorithm>
Expand Down Expand Up @@ -61,15 +62,15 @@ BOOST_AUTO_TEST_CASE(all_assembly_items)
{ "verbatim.asm", 2 }
};
EVMVersion evmVersion = solidity::test::CommonOptions::get().evmVersion();
Assembly _assembly{evmVersion, false, {}};
Assembly _assembly{evmVersion, false, solidity::test::CommonOptions::get().eofVersion(), {}};
auto root_asm = std::make_shared<std::string>("root.asm");
_assembly.setSourceLocation({1, 3, root_asm});

Assembly _subAsm{evmVersion, false, {}};
Assembly _subAsm{evmVersion, false, solidity::test::CommonOptions::get().eofVersion(), {}};
auto sub_asm = std::make_shared<std::string>("sub.asm");
_subAsm.setSourceLocation({6, 8, sub_asm});

Assembly _verbatimAsm(evmVersion, true, "");
Assembly _verbatimAsm(evmVersion, true, solidity::test::CommonOptions::get().eofVersion(), "");
auto verbatim_asm = std::make_shared<std::string>("verbatim.asm");
_verbatimAsm.setSourceLocation({8, 18, verbatim_asm});

Expand Down Expand Up @@ -246,7 +247,7 @@ BOOST_AUTO_TEST_CASE(immutables_and_its_source_maps)
{ *subName, 1 }
};

auto subAsm = std::make_shared<Assembly>(evmVersion, false, std::string{});
auto subAsm = std::make_shared<Assembly>(evmVersion, false, solidity::test::CommonOptions::get().eofVersion(), std::string{});
for (char i = 0; i < numImmutables; ++i)
{
for (int r = 0; r < numActualRefs; ++r)
Expand All @@ -256,7 +257,7 @@ BOOST_AUTO_TEST_CASE(immutables_and_its_source_maps)
}
}

Assembly assembly{evmVersion, true, {}};
Assembly assembly{evmVersion, true, solidity::test::CommonOptions::get().eofVersion(), {}};
for (char i = 1; i <= numImmutables; ++i)
{
assembly.setSourceLocation({10*i, 10*i + 3+i, assemblyName});
Expand Down Expand Up @@ -306,11 +307,11 @@ BOOST_AUTO_TEST_CASE(immutable)
{ "sub.asm", 1 }
};
EVMVersion evmVersion = solidity::test::CommonOptions::get().evmVersion();
Assembly _assembly{evmVersion, true, {}};
Assembly _assembly{evmVersion, true, solidity::test::CommonOptions::get().eofVersion(), {}};
auto root_asm = std::make_shared<std::string>("root.asm");
_assembly.setSourceLocation({1, 3, root_asm});

Assembly _subAsm{evmVersion, false, {}};
Assembly _subAsm{evmVersion, false, solidity::test::CommonOptions::get().eofVersion(), {}};
auto sub_asm = std::make_shared<std::string>("sub.asm");
_subAsm.setSourceLocation({6, 8, sub_asm});
_subAsm.appendImmutable("someImmutable");
Expand Down Expand Up @@ -404,10 +405,10 @@ BOOST_AUTO_TEST_CASE(immutable)
BOOST_AUTO_TEST_CASE(subobject_encode_decode)
{
EVMVersion evmVersion = solidity::test::CommonOptions::get().evmVersion();
Assembly assembly{evmVersion, true, {}};
Assembly assembly{evmVersion, true, solidity::test::CommonOptions::get().eofVersion(), {}};

std::shared_ptr<Assembly> subAsmPtr = std::make_shared<Assembly>(evmVersion, false, std::string{});
std::shared_ptr<Assembly> subSubAsmPtr = std::make_shared<Assembly>(evmVersion, false, std::string{});
std::shared_ptr<Assembly> subAsmPtr = std::make_shared<Assembly>(evmVersion, false, solidity::test::CommonOptions::get().eofVersion(), std::string{});
std::shared_ptr<Assembly> subSubAsmPtr = std::make_shared<Assembly>(evmVersion, false, solidity::test::CommonOptions::get().eofVersion(), std::string{});

assembly.appendSubroutine(subAsmPtr);
subAsmPtr->appendSubroutine(subSubAsmPtr);
Expand Down
4 changes: 2 additions & 2 deletions test/libevmasm/Optimiser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1346,8 +1346,8 @@ BOOST_AUTO_TEST_CASE(jumpdest_removal_subassemblies)
settings.evmVersion = solidity::test::CommonOptions::get().evmVersion();
settings.expectedExecutionsPerDeployment = OptimiserSettings{}.expectedExecutionsPerDeployment;

Assembly main{settings.evmVersion, false, {}};
AssemblyPointer sub = std::make_shared<Assembly>(settings.evmVersion, true, std::string{});
Assembly main{settings.evmVersion, false, solidity::test::CommonOptions::get().eofVersion(), {}};
AssemblyPointer sub = std::make_shared<Assembly>(settings.evmVersion, true, solidity::test::CommonOptions::get().eofVersion(), std::string{});

sub->append(u256(1));
auto t1 = sub->newTag();
Expand Down
1 change: 1 addition & 0 deletions test/libsolidity/Assembly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ evmasm::AssemblyItems compileContract(std::shared_ptr<CharStream> _sourceCode)
{
Compiler compiler(
solidity::test::CommonOptions::get().evmVersion(),
solidity::test::CommonOptions::get().eofVersion(),
RevertStrings::Default,
solidity::test::CommonOptions::get().optimize ? OptimiserSettings::standard() : OptimiserSettings::minimal()
);
Expand Down
1 change: 1 addition & 0 deletions test/libsolidity/SolidityExpressionCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ bytes compileFirstExpression(

CompilerContext context(
solidity::test::CommonOptions::get().evmVersion(),
solidity::test::CommonOptions::get().eofVersion(),
RevertStrings::Default
);
context.resetVisitedNodes(contract);
Expand Down
Loading