diff --git a/SolidityNameAndTypeResolution.cpp b/SolidityNameAndTypeResolution.cpp index f4be31f4b..b529f0b70 100644 --- a/SolidityNameAndTypeResolution.cpp +++ b/SolidityNameAndTypeResolution.cpp @@ -974,6 +974,24 @@ BOOST_AUTO_TEST_CASE(overflow_caused_by_ether_units) BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), TypeError); } +BOOST_AUTO_TEST_CASE(exp_operator_negative_exponent) +{ + char const* sourceCode = R"( + contract test { + function f() returns(uint d) { return 2 ** -3; } + })"; + BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), InternalCompilerError); +} + +BOOST_AUTO_TEST_CASE(exp_operator_const_overflowed) +{ + char const* sourceCode = R"( + contract test { + function f() returns(uint d) { return 10 ** 256; } + })"; + BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), InternalCompilerError); +} + BOOST_AUTO_TEST_SUITE_END() }