Introduce unchecked basic blocks.

This commit is contained in:
Bhargava Shastry
2021-06-09 18:38:20 +02:00
parent 1c43ecf9c8
commit 52f227e40a
2 changed files with 4 additions and 1 deletions
+3 -1
View File
@@ -303,7 +303,9 @@ string BlockStmtGenerator::visit()
return "\n";
incrementNestingDepth();
ostringstream block;
block << indentation() + "{\n";
// Make block unchecked with a small probability
bool unchecked = uRandDist->probable(s_uncheckedInvProb);
block << indentation() + (unchecked ? "unchecked " : "") + "{\n";
state->indent();
block << visitChildren();
state->unindent();
+1
View File
@@ -876,6 +876,7 @@ private:
size_t m_nestingDepth;
static constexpr unsigned s_maxStatements = 4;
static constexpr unsigned s_maxNestingDepth = 3;
static constexpr size_t s_uncheckedInvProb = 13;
};
class SolidityGenerator: public std::enable_shared_from_this<SolidityGenerator>