From 5a88f6fede9af886bc4a32cf1b3cf7c36ef7baad Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Thu, 25 Sep 2014 12:00:07 +0200 Subject: [PATCH] misc/coverity: Model __builtin_unreachable() This resolves 23 issues Coverity had identified by following the false path of an ASSERT(). Signed-off-by: Andrew Cooper --- misc/coverity/model.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/misc/coverity/model.c b/misc/coverity/model.c index fac2ecb794..bd62566a0d 100644 --- a/misc/coverity/model.c +++ b/misc/coverity/model.c @@ -120,6 +120,16 @@ void libxl__ctx_unlock(libxl_ctx *ctx) __coverity_recursive_lock_release__(&ctx->lock); } +/* + * Coverity doesn't understand __builtin_unreachable(), which causes it to + * incorrectly find issues based on continuing execution along the false + * branch of an ASSERT(). + */ +void __builtin_unreachable(void) +{ + __coverity_panic__(); +} + /* * Local variables: * mode: C -- 2.30.2