misc/coverity: Model __builtin_unreachable()
PATCH 1/1 misc/coverity: Model __builtin_unreachable()
This resolves 23 issues Coverity had identified by following the false path of an ASSERT().
--- misc/coverity/model.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
misc/coverity/model.c +10 -0
@@ -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"
Signature · 1 line
1.7.10.4
misc/coverity/model.c void libxl__ctx_unlock(libxl_ctx *ctx) · line 131
Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 24.09.14 at 15:53, <[email protected]> wrote:
/*
+ * Coverity doesn't understand__builtin_unreachable(), which causes it to
+ * incorrectly find issues based on continuing execution along the false
+ * branch of anASSERT().
+ */misc/coverity/model.c +4
-0+void __builtin_unreachable (void ) +{ +__coverity_panic__ (); +}
And (for those of us without intimate knowledge of Coverity) __coverity_panic__() does what? By its name I would conclude it terminates the current scan altogether...
Jan
Quoted 14 lines · Jan Beulich
misc/coverity/model.c void libxl__ctx_unlock(libxl_ctx *ctx) · line 131
Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 24.09.14 at 15:53, <[email protected]> wrote:
/*
+ * Coverity doesn't understand__builtin_unreachable(), which causes it to
+ * incorrectly find issues based on continuing execution along the false
+ * branch of anASSERT().
+ */misc/coverity/model.c +4
-0+void __builtin_unreachable (void ) +{ +__coverity_panic__ (); +}And (for those of us without intimate knowledge of Coverity)
__coverity_panic__()does what? By its name I would conclude it terminates the current scan altogether...
Quoted 2 lines
Jan
__coverity_panic__() is a coverity modelling function defined as "ending the current execution path". (See https://scan.coverity.com/tune which might be behind a login)
Its naming is somewhat unfortunate.
~Andrew