xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] misc/coverity: Model __builtin_unreachable()
@ 2014-09-24 13:53 Andrew Cooper
  2014-09-24 14:50 ` Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cooper @ 2014-09-24 13:53 UTC (permalink / raw)
  To: Xen-devel
  Cc: Keir Fraser, Ian Campbell, Andrew Cooper, Tim Deegan, coverity,
	Jan Beulich, Ian Jackson

This resolves 23 issues Coverity had identified by following the false path of
an ASSERT().

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: coverity@xenproject.org
CC: Keir Fraser <keir@xen.org>
CC: Jan Beulich <JBeulich@suse.com>
CC: Tim Deegan <tim@xen.org>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 misc/coverity/model.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/misc/coverity/model.c b/misc/coverity/model.c
index fac2ecb..bd62566 100644
--- a/misc/coverity/model.c
+++ b/misc/coverity/model.c
@@ -121,6 +121,16 @@ void libxl__ctx_unlock(libxl_ctx *ctx)
 }
 
 /*
+ * 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
  * c-file-style: "BSD"
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-24 14:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-24 13:53 [PATCH] misc/coverity: Model __builtin_unreachable() Andrew Cooper
2014-09-24 14:50 ` Jan Beulich
2014-09-24 14:56   ` Andrew Cooper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).