diff options
Diffstat (limited to 'libsolidity/analysis/SyntaxChecker.cpp')
-rw-r--r-- | libsolidity/analysis/SyntaxChecker.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libsolidity/analysis/SyntaxChecker.cpp b/libsolidity/analysis/SyntaxChecker.cpp index ab883a21..0bc20f2e 100644 --- a/libsolidity/analysis/SyntaxChecker.cpp +++ b/libsolidity/analysis/SyntaxChecker.cpp @@ -138,25 +138,25 @@ void SyntaxChecker::endVisit(ModifierDefinition const& _modifier) m_placeholderFound = false; } -void SyntaxChecker::checkSingleStatementVariableDeclaration(ASTNode const* _statement) +void SyntaxChecker::checkSingleStatementVariableDeclaration(ASTNode const& _statement) { - auto varDecl = dynamic_cast<VariableDeclarationStatement const*>(_statement); + auto varDecl = dynamic_cast<VariableDeclarationStatement const*>(&_statement); if (varDecl) - m_errorReporter.syntaxError(_statement->location(), "Variable declarations can only be used inside blocks."); + m_errorReporter.syntaxError(_statement.location(), "Variable declarations can only be used inside blocks."); } bool SyntaxChecker::visit(IfStatement const& _ifStatement) { - checkSingleStatementVariableDeclaration(&_ifStatement.trueStatement()); + checkSingleStatementVariableDeclaration(_ifStatement.trueStatement()); if (Statement const* _statement = _ifStatement.falseStatement()) - checkSingleStatementVariableDeclaration(_statement); + checkSingleStatementVariableDeclaration(*_statement); return true; } bool SyntaxChecker::visit(WhileStatement const& _whileStatement) { m_inLoopDepth++; - checkSingleStatementVariableDeclaration(&_whileStatement.body()); + checkSingleStatementVariableDeclaration(_whileStatement.body()); return true; } @@ -168,7 +168,7 @@ void SyntaxChecker::endVisit(WhileStatement const&) bool SyntaxChecker::visit(ForStatement const& _forStatement) { m_inLoopDepth++; - checkSingleStatementVariableDeclaration(&_forStatement.body()); + checkSingleStatementVariableDeclaration(_forStatement.body()); return true; } |