aboutsummaryrefslogtreecommitdiffstats
path: root/StructuralGasEstimator.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-05-07 17:05:05 +0800
committerchriseth <c@ethdev.com>2015-05-07 17:14:07 +0800
commit5d2c36603fec5e1027a7bc1666a87cc9aed45bd0 (patch)
tree7d266a2072035993e6786d81ec182290b2021191 /StructuralGasEstimator.cpp
parentd8ddbeed2bfefd34ee5e459b6cb9341cfcdaadfb (diff)
downloaddexon-solidity-5d2c36603fec5e1027a7bc1666a87cc9aed45bd0.tar.gz
dexon-solidity-5d2c36603fec5e1027a7bc1666a87cc9aed45bd0.tar.zst
dexon-solidity-5d2c36603fec5e1027a7bc1666a87cc9aed45bd0.zip
Added assertions.
Diffstat (limited to 'StructuralGasEstimator.cpp')
-rw-r--r--StructuralGasEstimator.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/StructuralGasEstimator.cpp b/StructuralGasEstimator.cpp
index c90981a7..ececd711 100644
--- a/StructuralGasEstimator.cpp
+++ b/StructuralGasEstimator.cpp
@@ -36,6 +36,7 @@ StructuralGasEstimator::ASTGasConsumptionSelfAccumulated StructuralGasEstimator:
vector<ASTNode const*> const& _ast
)
{
+ solAssert(std::count(_ast.begin(), _ast.end(), nullptr) == 0, "");
map<SourceLocation, GasMeter::GasConsumption> particularCosts;
GasMeter meter;
@@ -64,6 +65,7 @@ map<ASTNode const*, GasMeter::GasConsumption> StructuralGasEstimator::breakToSta
vector<ASTNode const*> const& _roots
)
{
+ solAssert(std::count(_roots.begin(), _roots.end(), nullptr) == 0, "");
// first pass: statementDepth[node] is the distance from the deepend statement to node
// in direction of the tree root (or undefined if not possible)
map<ASTNode const*, int> statementDepth;