aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Baumann <marenz@supradigital.org>2018-12-05 19:22:18 +0800
committerMathias Baumann <marenz@supradigital.org>2018-12-06 01:01:41 +0800
commitd0204eef2fa26c6774835cfe6027f053b85f98ec (patch)
tree1c2ec758048a57021cb659fd0da8d4ccaf75252b
parentf4e9c70ecc7d4a8c354085b75fea720ab1ebe3a7 (diff)
downloaddexon-solidity-d0204eef2fa26c6774835cfe6027f053b85f98ec.tar.gz
dexon-solidity-d0204eef2fa26c6774835cfe6027f053b85f98ec.tar.zst
dexon-solidity-d0204eef2fa26c6774835cfe6027f053b85f98ec.zip
SSAValueTracker should only use nullptr for default values
-rw-r--r--libyul/optimiser/SSAValueTracker.cpp2
-rw-r--r--libyul/optimiser/SSAValueTracker.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/libyul/optimiser/SSAValueTracker.cpp b/libyul/optimiser/SSAValueTracker.cpp
index 35b29b04..ef96c379 100644
--- a/libyul/optimiser/SSAValueTracker.cpp
+++ b/libyul/optimiser/SSAValueTracker.cpp
@@ -37,7 +37,7 @@ void SSAValueTracker::operator()(VariableDeclaration const& _varDecl)
{
if (_varDecl.variables.size() == 1)
setValue(_varDecl.variables.front().name, _varDecl.value.get());
- else
+ else if (!_varDecl.value)
for (auto const& var: _varDecl.variables)
setValue(var.name, nullptr);
}
diff --git a/libyul/optimiser/SSAValueTracker.h b/libyul/optimiser/SSAValueTracker.h
index e182e013..efec2200 100644
--- a/libyul/optimiser/SSAValueTracker.h
+++ b/libyul/optimiser/SSAValueTracker.h
@@ -33,6 +33,8 @@ namespace yul
* Class that walks the AST and stores the initial value of each variable
* that is never assigned to.
*
+ * Default value is represented as nullptr.
+ *
* Prerequisite: Disambiguator
*/
class SSAValueTracker: public ASTWalker