]> git.lyx.org Git - features.git/commitdiff
Try another way of convincing coverity that everything is fine
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 4 Apr 2017 07:35:55 +0000 (09:35 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 4 Apr 2017 07:38:43 +0000 (09:38 +0200)
We have a false positive here, but annotating with coverity[] comments
is not very convenient. Let's try to use good old assertions instead.

src/insets/InsetBibitem.cpp

index 22abdf02d6b7639db8aa7e8f472107c0db1d06e4..ae6105bb62fce88dee3faf058ab8616f73bab9ee 100644 (file)
@@ -36,6 +36,7 @@
 
 #include "frontends/alert.h"
 
+#include "support/lassert.h"
 #include "support/convert.h"
 #include "support/debug.h"
 #include "support/docstream.h"
@@ -67,11 +68,12 @@ InsetBibitem::InsetBibitem(Buffer * buf, InsetCommandParams const & p)
 
 InsetBibitem::~InsetBibitem()
 {
-       if (isBufferLoaded())
+       if (isBufferLoaded()) {
                /* Coverity believes that this may throw an exception, but
                 * actually this code path is not taken when buffer_ == 0 */
-               // coverity[fun_call_w_exception]
+               LATTEST(buffer_);
                buffer().invalidateBibinfoCache();
+       }
 }