aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/ExpressionCompiler.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-07-27 18:12:30 +0800
committerGitHub <noreply@github.com>2017-07-27 18:12:30 +0800
commit89fadd6935bd1dda4c8a4846c8fa43ce71cc85cc (patch)
tree5314a46d2b762184cb351720cf305310fb7ff62f /libsolidity/codegen/ExpressionCompiler.cpp
parent07e0a7e090111dd49e0bb6af96a4036f1bd186ac (diff)
parent80980309867ce8cdc70ebb5bb36bbe01cfd01361 (diff)
downloaddexon-solidity-89fadd6935bd1dda4c8a4846c8fa43ce71cc85cc.tar.gz
dexon-solidity-89fadd6935bd1dda4c8a4846c8fa43ce71cc85cc.tar.zst
dexon-solidity-89fadd6935bd1dda4c8a4846c8fa43ce71cc85cc.zip
Merge pull request #2645 from ethereum/asserts
Use solAssert where possible
Diffstat (limited to 'libsolidity/codegen/ExpressionCompiler.cpp')
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index 8a28b454..a35008bf 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -378,8 +378,7 @@ bool ExpressionCompiler::visit(UnaryOperation const& _unaryOperation)
m_context << u256(0) << Instruction::SUB;
break;
default:
- BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Invalid unary operator: " +
- string(Token::toString(_unaryOperation.getOperator()))));
+ solAssert(false, "Invalid unary operator: " + string(Token::toString(_unaryOperation.getOperator())));
}
return false;
}
@@ -900,7 +899,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
break;
}
default:
- BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Invalid function type."));
+ solAssert(false, "Invalid function type.");
}
}
return false;
@@ -1066,7 +1065,7 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
true
);
else
- BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Invalid member access to integer."));
+ solAssert(false, "Invalid member access to integer");
break;
case Type::Category::Function:
solAssert(!!_memberAccess.expression().annotation().type->memberType(member),
@@ -1100,7 +1099,7 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
m_context << u256(0) << Instruction::CALLDATALOAD
<< (u256(0xffffffff) << (256 - 32)) << Instruction::AND;
else
- BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Unknown magic member."));
+ solAssert(false, "Unknown magic member.");
break;
case Type::Category::Struct:
{
@@ -1177,7 +1176,7 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
break;
}
default:
- BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Member access to unknown type."));
+ solAssert(false, "Member access to unknown type.");
}
return false;
}
@@ -1332,7 +1331,7 @@ void ExpressionCompiler::endVisit(Identifier const& _identifier)
}
else
{
- BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Identifier type not expected in expression context."));
+ solAssert(false, "Identifier type not expected in expression context.");
}
}
@@ -1415,7 +1414,7 @@ void ExpressionCompiler::appendCompareOperatorCode(Token::Value _operator, Type
m_context << (isSigned ? Instruction::SLT : Instruction::LT);
break;
default:
- BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Unknown comparison operator."));
+ solAssert(false, "Unknown comparison operator.");
}
}
}
@@ -1427,7 +1426,7 @@ void ExpressionCompiler::appendOrdinaryBinaryOperatorCode(Token::Value _operator
else if (Token::isBitOp(_operator))
appendBitOperatorCode(_operator);
else
- BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Unknown binary operator."));
+ solAssert(false, "Unknown binary operator.");
}
void ExpressionCompiler::appendArithmeticOperatorCode(Token::Value _operator, Type const& _type)
@@ -1466,7 +1465,7 @@ void ExpressionCompiler::appendArithmeticOperatorCode(Token::Value _operator, Ty
m_context << Instruction::EXP;
break;
default:
- BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Unknown arithmetic operator."));
+ solAssert(false, "Unknown arithmetic operator.");
}
}
@@ -1484,7 +1483,7 @@ void ExpressionCompiler::appendBitOperatorCode(Token::Value _operator)
m_context << Instruction::XOR;
break;
default:
- BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Unknown bit operator."));
+ solAssert(false, "Unknown bit operator.");
}
}
@@ -1528,7 +1527,7 @@ void ExpressionCompiler::appendShiftOperatorCode(Token::Value _operator, Type co
break;
case Token::SHR:
default:
- BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Unknown shift operator."));
+ solAssert(false, "Unknown shift operator.");
}
}