aboutsummaryrefslogtreecommitdiffstats
path: root/libyul/Exceptions.h
diff options
context:
space:
mode:
Diffstat (limited to 'libyul/Exceptions.h')
-rw-r--r--libyul/Exceptions.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/libyul/Exceptions.h b/libyul/Exceptions.h
index c423b66f..0c421dbf 100644
--- a/libyul/Exceptions.h
+++ b/libyul/Exceptions.h
@@ -30,6 +30,11 @@ namespace yul
struct YulException: virtual Exception {};
struct OptimizerException: virtual YulException {};
+struct YulAssertion: virtual YulException {};
+
+/// Assertion that throws an YulAssertion containing the given description if it is not met.
+#define yulAssert(CONDITION, DESCRIPTION) \
+ assertThrow(CONDITION, ::dev::yul::YulException, DESCRIPTION)
}
}