mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
yul proto fuzzer: Refactor dataoffset/size specification
This commit is contained in:
parent
d033c2f767
commit
79f1917422
@ -1767,12 +1767,12 @@ void ProtoConverter::visit(LeaveStmt const&)
|
|||||||
m_output << "leave\n";
|
m_output << "leave\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
string ProtoConverter::getObjectIdentifier(ObjectId const& _x)
|
string ProtoConverter::getObjectIdentifier(unsigned _x)
|
||||||
{
|
{
|
||||||
unsigned currentId = currentObjectId();
|
unsigned currentId = currentObjectId();
|
||||||
yulAssert(m_objectScopeTree.size() > currentId, "Proto fuzzer: Error referencing object");
|
yulAssert(m_objectScopeTree.size() > currentId, "Proto fuzzer: Error referencing object");
|
||||||
std::vector<std::string> objectIdsInScope = m_objectScopeTree[currentId];
|
std::vector<std::string> objectIdsInScope = m_objectScopeTree[currentId];
|
||||||
return objectIdsInScope[_x.id() % objectIdsInScope.size()];
|
return objectIdsInScope[_x % objectIdsInScope.size()];
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProtoConverter::visit(Code const& _x)
|
void ProtoConverter::visit(Code const& _x)
|
||||||
|
@ -298,7 +298,7 @@ private:
|
|||||||
|
|
||||||
/// Returns a pseudo-randomly chosen object identifier that is in the
|
/// Returns a pseudo-randomly chosen object identifier that is in the
|
||||||
/// scope of the Yul object being visited.
|
/// scope of the Yul object being visited.
|
||||||
std::string getObjectIdentifier(ObjectId const& _x);
|
std::string getObjectIdentifier(unsigned _x);
|
||||||
|
|
||||||
/// Return new object identifier as string. Identifier string
|
/// Return new object identifier as string. Identifier string
|
||||||
/// is a template of the form "\"object<n>\"" where <n> is
|
/// is a template of the form "\"object<n>\"" where <n> is
|
||||||
|
@ -174,7 +174,7 @@ message UnaryOpData {
|
|||||||
OFFSET = 2;
|
OFFSET = 2;
|
||||||
}
|
}
|
||||||
required UOpData op = 1;
|
required UOpData op = 1;
|
||||||
required ObjectId identifier = 2;
|
required uint64 identifier = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message TernaryOp {
|
message TernaryOp {
|
||||||
@ -208,18 +208,6 @@ message ExtCodeCopy {
|
|||||||
required Expression size = 4;
|
required Expression size = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ObjectId {
|
|
||||||
required uint64 id = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message DataSize {
|
|
||||||
required ObjectId identifier = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message DataOffset {
|
|
||||||
required ObjectId identifier = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message NullaryOp {
|
message NullaryOp {
|
||||||
enum NOp {
|
enum NOp {
|
||||||
PC = 1;
|
PC = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user