mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Put arguments in parantheses in assert macro definitions
This commit is contained in:
@@ -63,7 +63,7 @@ inline std::string stringOrDefault(std::string _string, std::string _defaultStri
|
||||
if (!(_condition)) \
|
||||
solThrow( \
|
||||
_exceptionType, \
|
||||
::solidity::util::assertions::stringOrDefault(_description, _defaultDescription) \
|
||||
::solidity::util::assertions::stringOrDefault((_description), (_defaultDescription)) \
|
||||
); \
|
||||
} \
|
||||
while (false)
|
||||
@@ -72,6 +72,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, "Assertion failed")
|
||||
assertThrowWithDefaultDescription((_condition), _exceptionType, (_description), "Assertion failed")
|
||||
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ struct Exception: virtual std::exception, virtual boost::exception
|
||||
#define solThrow(_exceptionType, _description) \
|
||||
::boost::throw_exception( \
|
||||
_exceptionType() << \
|
||||
::solidity::util::errinfo_comment(_description) << \
|
||||
::solidity::util::errinfo_comment((_description)) << \
|
||||
::boost::throw_function(ETH_FUNC) << \
|
||||
::boost::throw_file(__FILE__) << \
|
||||
::boost::throw_line(__LINE__) \
|
||||
|
||||
Reference in New Issue
Block a user