aboutsummaryrefslogtreecommitdiffstats
path: root/libevmasm
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-08-22 20:55:28 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-08-22 20:55:28 +0800
commitf2d6226718a226ae4764bd7d1379c6e50c7f269a (patch)
tree8e5988ff12f610689fc25f4650ca7e758361384a /libevmasm
parentf38429fef88b644e9c54c1bf2a1abe754dbd324d (diff)
downloaddexon-solidity-f2d6226718a226ae4764bd7d1379c6e50c7f269a.tar
dexon-solidity-f2d6226718a226ae4764bd7d1379c6e50c7f269a.tar.gz
dexon-solidity-f2d6226718a226ae4764bd7d1379c6e50c7f269a.tar.bz2
dexon-solidity-f2d6226718a226ae4764bd7d1379c6e50c7f269a.tar.lz
dexon-solidity-f2d6226718a226ae4764bd7d1379c6e50c7f269a.tar.xz
dexon-solidity-f2d6226718a226ae4764bd7d1379c6e50c7f269a.tar.zst
dexon-solidity-f2d6226718a226ae4764bd7d1379c6e50c7f269a.zip
Some smaller issues found by Covertiy Scan
Diffstat (limited to 'libevmasm')
-rw-r--r--libevmasm/CommonSubexpressionEliminator.cpp1
-rw-r--r--libevmasm/CommonSubexpressionEliminator.h2
2 files changed, 2 insertions, 1 deletions
diff --git a/libevmasm/CommonSubexpressionEliminator.cpp b/libevmasm/CommonSubexpressionEliminator.cpp
index 70324e7f..293cb02c 100644
--- a/libevmasm/CommonSubexpressionEliminator.cpp
+++ b/libevmasm/CommonSubexpressionEliminator.cpp
@@ -220,6 +220,7 @@ void CSECodeGenerator::addDependencies(Id _c)
if (m_neededBy.count(_c))
return; // we already computed the dependencies for _c
ExpressionClasses::Expression expr = m_expressionClasses.representative(_c);
+ assertThrow(expr.item, OptimizerException, "");
if (expr.item->type() == UndefinedItem)
BOOST_THROW_EXCEPTION(
// If this exception happens, we need to find a different way to generate the
diff --git a/libevmasm/CommonSubexpressionEliminator.h b/libevmasm/CommonSubexpressionEliminator.h
index f2473200..0b957a0e 100644
--- a/libevmasm/CommonSubexpressionEliminator.h
+++ b/libevmasm/CommonSubexpressionEliminator.h
@@ -147,7 +147,7 @@ private:
AssemblyItems m_generatedItems;
/// Current height of the stack relative to the start.
- int m_stackHeight;
+ int m_stackHeight = 0;
/// If (b, a) is in m_requests then b is needed to compute a.
std::multimap<Id, Id> m_neededBy;
/// Current content of the stack.