mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove error label / invalid jump label.
This commit is contained in:
@@ -299,25 +299,6 @@ void CompilerUtils::zeroInitialiseMemoryArray(ArrayType const& _type)
|
||||
m_context << Instruction::SWAP1 << Instruction::POP;
|
||||
}
|
||||
|
||||
void CompilerUtils::memoryCopyPrecompile()
|
||||
{
|
||||
// Stack here: size target source
|
||||
|
||||
m_context.appendInlineAssembly(R"(
|
||||
{
|
||||
let words := div(add(len, 31), 32)
|
||||
let cost := add(15, mul(3, words))
|
||||
jumpi(invalidJumpLabel, iszero(call(cost, $identityContractAddress, 0, src, len, dst, len)))
|
||||
}
|
||||
)",
|
||||
{ "len", "dst", "src" },
|
||||
map<string, string> {
|
||||
{ "$identityContractAddress", toString(identityContractAddress) }
|
||||
}
|
||||
);
|
||||
m_context << Instruction::POP << Instruction::POP << Instruction::POP;
|
||||
}
|
||||
|
||||
void CompilerUtils::memoryCopy32()
|
||||
{
|
||||
// Stack here: size target source
|
||||
|
||||
@@ -109,10 +109,6 @@ public:
|
||||
/// Stack post: <updated_memptr>
|
||||
void zeroInitialiseMemoryArray(ArrayType const& _type);
|
||||
|
||||
/// Uses a CALL to the identity contract to perform a memory-to-memory copy.
|
||||
/// Stack pre: <size> <target> <source>
|
||||
/// Stack post:
|
||||
void memoryCopyPrecompile();
|
||||
/// Copies full 32 byte words in memory (regions cannot overlap), i.e. may copy more than length.
|
||||
/// Stack pre: <size> <target> <source>
|
||||
/// Stack post:
|
||||
|
||||
@@ -278,8 +278,6 @@ private:
|
||||
{
|
||||
if (_label.id == Scope::Label::unassignedLabelId)
|
||||
_label.id = m_state.newLabelId();
|
||||
else if (_label.id == Scope::Label::errorLabelId)
|
||||
_label.id = size_t(m_state.assembly.errorTag().data());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -73,7 +73,6 @@ struct Scope
|
||||
struct Label
|
||||
{
|
||||
size_t id = unassignedLabelId;
|
||||
static const size_t errorLabelId = -1;
|
||||
static const size_t unassignedLabelId = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -39,10 +39,6 @@ using namespace dev::solidity::assembly;
|
||||
ScopeFiller::ScopeFiller(ScopeFiller::Scopes& _scopes, ErrorList& _errors):
|
||||
m_scopes(_scopes), m_errors(_errors)
|
||||
{
|
||||
// Make the Solidity ErrorTag available to inline assembly
|
||||
Scope::Label errorLabel;
|
||||
errorLabel.id = Scope::Label::errorLabelId;
|
||||
scope(nullptr).identifiers["invalidJumpLabel"] = errorLabel;
|
||||
m_currentScope = &scope(nullptr);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user