mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Introduce unchecked basic blocks.
This commit is contained in:
parent
86fec73a8c
commit
fdb1bc0b3d
@ -303,7 +303,9 @@ string BlockStmtGenerator::visit()
|
|||||||
return "\n";
|
return "\n";
|
||||||
incrementNestingDepth();
|
incrementNestingDepth();
|
||||||
ostringstream block;
|
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();
|
state->indent();
|
||||||
block << visitChildren();
|
block << visitChildren();
|
||||||
state->unindent();
|
state->unindent();
|
||||||
|
@ -876,6 +876,7 @@ private:
|
|||||||
size_t m_nestingDepth;
|
size_t m_nestingDepth;
|
||||||
static constexpr unsigned s_maxStatements = 4;
|
static constexpr unsigned s_maxStatements = 4;
|
||||||
static constexpr unsigned s_maxNestingDepth = 3;
|
static constexpr unsigned s_maxNestingDepth = 3;
|
||||||
|
static constexpr size_t s_uncheckedInvProb = 13;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SolidityGenerator: public std::enable_shared_from_this<SolidityGenerator>
|
class SolidityGenerator: public std::enable_shared_from_this<SolidityGenerator>
|
||||||
|
Loading…
Reference in New Issue
Block a user