aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis/ConstantEvaluator.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-10-06 03:17:54 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-10-06 03:17:54 +0800
commited62b2583cf96a970dd610fa3ce837942bb67500 (patch)
tree53e82d82f7458e6eacbf11086b655c102d74d8f6 /libsolidity/analysis/ConstantEvaluator.cpp
parentc28ed2a6191fd16c4be92a9adb53d5ff3215a34d (diff)
downloaddexon-solidity-ed62b2583cf96a970dd610fa3ce837942bb67500.tar.gz
dexon-solidity-ed62b2583cf96a970dd610fa3ce837942bb67500.tar.zst
dexon-solidity-ed62b2583cf96a970dd610fa3ce837942bb67500.zip
Use the proper error reporting interface in ConstantEvaluator
Diffstat (limited to 'libsolidity/analysis/ConstantEvaluator.cpp')
-rw-r--r--libsolidity/analysis/ConstantEvaluator.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/libsolidity/analysis/ConstantEvaluator.cpp b/libsolidity/analysis/ConstantEvaluator.cpp
index 7057eab7..6636ad97 100644
--- a/libsolidity/analysis/ConstantEvaluator.cpp
+++ b/libsolidity/analysis/ConstantEvaluator.cpp
@@ -22,17 +22,17 @@
#include <libsolidity/analysis/ConstantEvaluator.h>
#include <libsolidity/ast/AST.h>
+#include <libsolidity/interface/ErrorReporter.h>
using namespace std;
using namespace dev;
using namespace dev::solidity;
-
void ConstantEvaluator::endVisit(UnaryOperation const& _operation)
{
TypePointer const& subType = _operation.subExpression().annotation().type;
if (!dynamic_cast<RationalNumberType const*>(subType.get()))
- BOOST_THROW_EXCEPTION(_operation.subExpression().createTypeError("Invalid constant expression."));
+ m_errorReporter.fatalTypeError(_operation.subExpression().location(), "Invalid constant expression.");
TypePointer t = subType->unaryOperatorResult(_operation.getOperator());
_operation.annotation().type = t;
}
@@ -42,9 +42,9 @@ void ConstantEvaluator::endVisit(BinaryOperation const& _operation)
TypePointer const& leftType = _operation.leftExpression().annotation().type;
TypePointer const& rightType = _operation.rightExpression().annotation().type;
if (!dynamic_cast<RationalNumberType const*>(leftType.get()))
- BOOST_THROW_EXCEPTION(_operation.leftExpression().createTypeError("Invalid constant expression."));
+ m_errorReporter.fatalTypeError(_operation.leftExpression().location(), "Invalid constant expression.");
if (!dynamic_cast<RationalNumberType const*>(rightType.get()))
- BOOST_THROW_EXCEPTION(_operation.rightExpression().createTypeError("Invalid constant expression."));
+ m_errorReporter.fatalTypeError(_operation.rightExpression().location(), "Invalid constant expression.");
TypePointer commonType = leftType->binaryOperatorResult(_operation.getOperator(), rightType);
if (Token::isCompareOp(_operation.getOperator()))
commonType = make_shared<BoolType>();
@@ -55,5 +55,5 @@ void ConstantEvaluator::endVisit(Literal const& _literal)
{
_literal.annotation().type = Type::forLiteral(_literal);
if (!_literal.annotation().type)
- BOOST_THROW_EXCEPTION(_literal.createTypeError("Invalid literal value."));
+ m_errorReporter.fatalTypeError(_literal.location(), "Invalid literal value.");
}