Merge pull request #8273 from ethereum/fix-8271

yul proto fuzzer: Support boolean literal generation
This commit is contained in:
chriseth authored and GitHub committed 2020-02-10 17:35:09 +01:00
commit db2eece7fc
2 files changed
+5

No files matched your search

+4
View File
@@ -120,6 +120,8 @@ string ProtoConverter::visit(Literal const& _x)
return "0x" + createHex(_x.hexval());
case Literal::kStrval:
return "\"" + createAlphaNum(_x.strval()) + "\"";
case Literal::kBoolval:
return _x.boolval() ? "true" : "false";
case Literal::LITERAL_ONEOF_NOT_SET:
return dictionaryToken();
}
@@ -1170,6 +1172,8 @@ void ProtoConverter::visit(CaseStmt const& _x)
if (noDoubleQuoteStr.empty())
yulAssert(literalVal == 0, "Proto fuzzer: Empty string does not evaluate to zero");
}
else if (_x.case_lit().has_boolval())
literalVal = _x.case_lit().boolval() ? u256(1) : u256(0);
else
literalVal = u256(literal);
+1
View File
@@ -100,6 +100,7 @@ message Literal {
uint64 intval = 1;
string hexval = 2;
string strval = 3;
bool boolval = 4;
}
}