mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Initial working version of rjumps.
This commit is contained in:
@@ -267,7 +267,7 @@ BOOST_AUTO_TEST_CASE(immutables_and_its_source_maps)
|
||||
|
||||
checkCompilation(assembly);
|
||||
|
||||
string const sourceMappings = AssemblyItem::computeSourceMapping(assembly.items(), indices);
|
||||
string const sourceMappings = AssemblyItem::computeSourceMapping(assembly.codeSections().at(0).items, indices);
|
||||
auto const numberOfMappings = std::count(sourceMappings.begin(), sourceMappings.end(), ';');
|
||||
|
||||
LinkerObject const& obj = assembly.assemble();
|
||||
|
||||
@@ -1296,7 +1296,7 @@ BOOST_AUTO_TEST_CASE(jumpdest_removal_subassemblies)
|
||||
u256(8)
|
||||
};
|
||||
BOOST_CHECK_EQUAL_COLLECTIONS(
|
||||
main.items().begin(), main.items().end(),
|
||||
main.codeSections().at(0).items.begin(),main.codeSections().at(0).items.end(),
|
||||
expectationMain.begin(), expectationMain.end()
|
||||
);
|
||||
|
||||
@@ -1304,7 +1304,7 @@ BOOST_AUTO_TEST_CASE(jumpdest_removal_subassemblies)
|
||||
u256(1), t1.tag(), u256(2), Instruction::JUMP, t4.tag(), u256(7), t4.pushTag(), Instruction::JUMP
|
||||
};
|
||||
BOOST_CHECK_EQUAL_COLLECTIONS(
|
||||
sub->items().begin(), sub->items().end(),
|
||||
sub->codeSections().at(0).items.begin(), sub->codeSections().at(0).items.end(),
|
||||
expectationSub.begin(), expectationSub.end()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ evmasm::AssemblyItems compileContract(std::shared_ptr<CharStream> _sourceCode)
|
||||
);
|
||||
compiler.compileContract(*contract, map<ContractDefinition const*, shared_ptr<Compiler const>>{}, bytes());
|
||||
|
||||
return compiler.runtimeAssembly().items();
|
||||
return compiler.runtimeAssembly().codeSections().at(0).items;
|
||||
}
|
||||
BOOST_FAIL("No contract found in source.");
|
||||
return AssemblyItems();
|
||||
|
||||
@@ -444,6 +444,9 @@ u256 EVMInstructionInterpreter::eval(
|
||||
case Instruction::CALLF:
|
||||
case Instruction::RETF:
|
||||
case Instruction::JUMPF:
|
||||
case Instruction::RJUMP:
|
||||
case Instruction::RJUMPI:
|
||||
case Instruction::RJUMPV:
|
||||
{
|
||||
yulAssert(false, "");
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user