Merge pull request #8288 from ethereum/fix-8108

yul proto fuzzer: Refactor dataoffset/size specification
This commit is contained in:
Daniel Kirchner 2020-02-11 10:45:55 +01:00 committed by GitHub
commit 5214cb0e76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 16 deletions

View File

@ -1767,12 +1767,12 @@ void ProtoConverter::visit(LeaveStmt const&)
m_output << "leave\n";
}
string ProtoConverter::getObjectIdentifier(ObjectId const& _x)
string ProtoConverter::getObjectIdentifier(unsigned _x)
{
unsigned currentId = currentObjectId();
yulAssert(m_objectScopeTree.size() > currentId, "Proto fuzzer: Error referencing object");
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)

View File

@ -298,7 +298,7 @@ private:
/// Returns a pseudo-randomly chosen object identifier that is in the
/// 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
/// is a template of the form "\"object<n>\"" where <n> is

View File

@ -174,7 +174,7 @@ message UnaryOpData {
OFFSET = 2;
}
required UOpData op = 1;
required ObjectId identifier = 2;
required uint64 identifier = 2;
}
message TernaryOp {
@ -208,18 +208,6 @@ message ExtCodeCopy {
required Expression size = 4;
}
message ObjectId {
required uint64 id = 1;
}
message DataSize {
required ObjectId identifier = 1;
}
message DataOffset {
required ObjectId identifier = 1;
}
message NullaryOp {
enum NOp {
PC = 1;