diff --git a/liblangutil/Exceptions.h b/liblangutil/Exceptions.h index 68f109717..9a4051a87 100644 --- a/liblangutil/Exceptions.h +++ b/liblangutil/Exceptions.h @@ -47,16 +47,16 @@ struct InvalidAstError: virtual util::Exception {}; /// Assertion that throws an InternalCompilerError containing the given description if it is not met. #define solAssert(CONDITION, DESCRIPTION) \ - assertThrow(CONDITION, ::solidity::langutil::InternalCompilerError, DESCRIPTION) + assertThrowWithDefaultDescription(CONDITION, ::solidity::langutil::InternalCompilerError, DESCRIPTION, "Solidity assertion failed") #define solUnimplementedAssert(CONDITION, DESCRIPTION) \ - assertThrow(CONDITION, ::solidity::langutil::UnimplementedFeatureError, DESCRIPTION) + assertThrowWithDefaultDescription(CONDITION, ::solidity::langutil::UnimplementedFeatureError, DESCRIPTION, "Unimplemented feature") #define solUnimplemented(DESCRIPTION) \ solUnimplementedAssert(false, DESCRIPTION) #define astAssert(CONDITION, DESCRIPTION) \ - assertThrow(CONDITION, ::solidity::langutil::InvalidAstError, DESCRIPTION) + assertThrowWithDefaultDescription(CONDITION, ::solidity::langutil::InvalidAstError, DESCRIPTION, "AST assertion failed") using errorSourceLocationInfo = std::pair; diff --git a/libsmtutil/Exceptions.h b/libsmtutil/Exceptions.h index 29011dab9..85f751f08 100644 --- a/libsmtutil/Exceptions.h +++ b/libsmtutil/Exceptions.h @@ -27,6 +27,6 @@ namespace solidity::smtutil struct SMTLogicError: virtual util::Exception {}; #define smtAssert(CONDITION, DESCRIPTION) \ - assertThrow(CONDITION, SMTLogicError, DESCRIPTION) + assertThrowWithDefaultDescription(CONDITION, SMTLogicError, DESCRIPTION, "SMT assertion failed") } diff --git a/libsolutil/Assertions.h b/libsolutil/Assertions.h index 815a76290..f04e90a1f 100644 --- a/libsolutil/Assertions.h +++ b/libsolutil/Assertions.h @@ -77,6 +77,6 @@ inline std::string stringOrDefault(std::string _string, std::string _defaultStri /// Use it as assertThrow(1 == 1, ExceptionType, "Mathematics is wrong."); /// The second parameter must be an exception class (rather than an instance). #define assertThrow(_condition, _exceptionType, _description) \ - assertThrowWithDefaultDescription(_condition, _exceptionType, _description, "") + assertThrowWithDefaultDescription(_condition, _exceptionType, _description, "Assertion failed") } diff --git a/libyul/Exceptions.h b/libyul/Exceptions.h index 3be61bd18..96e07d620 100644 --- a/libyul/Exceptions.h +++ b/libyul/Exceptions.h @@ -53,6 +53,6 @@ struct StackTooDeepError: virtual YulException /// Assertion that throws an YulAssertion containing the given description if it is not met. #define yulAssert(CONDITION, DESCRIPTION) \ - assertThrow(CONDITION, ::solidity::yul::YulAssertion, DESCRIPTION) + assertThrowWithDefaultDescription(CONDITION, ::solidity::yul::YulAssertion, DESCRIPTION, "Yul assertion failed") }