summaryrefslogtreecommitdiff
path: root/third-party
diff options
context:
space:
mode:
authorPeter Dillinger <peterd@fb.com>2022-02-07 18:20:51 -0800
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>2022-02-07 18:24:36 -0800
commit5cb137a860654e98ee30a3913f16bb07faebab2b (patch)
treeb37f361e35d08119798d8dde7f6eeca629900fc5 /third-party
parentbbe4763ee44b539ef52bdd339d1dfccb0feec32e (diff)
Work around some new clang-analyze failures (#9515)
Summary: ... seen only in internal clang-analyze runs after https://github.com/facebook/rocksdb/issues/9481 * Mostly, this works around falsely reported leaks by using std::unique_ptr in some places where clang-analyze was getting confused. (I didn't see any changes in C++17 that could make our Status implementation leak memory.) * Also fixed SetBGError returning address of a stack variable. * Also fixed another false null deref report by adding an assert. Also, use SKIP_LINK=1 to speed up `make analyze` Pull Request resolved: https://github.com/facebook/rocksdb/pull/9515 Test Plan: Was able to reproduce the reported errors locally and verify they're fixed (except SetBGError). Otherwise, existing tests Reviewed By: hx235 Differential Revision: D34054630 Pulled By: pdillinger fbshipit-source-id: 38600ef3da75ddca307dff96b7a1a523c2885c2e
Diffstat (limited to 'third-party')
-rw-r--r--third-party/gtest-1.8.1/fused-src/gtest/gtest.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/third-party/gtest-1.8.1/fused-src/gtest/gtest.h b/third-party/gtest-1.8.1/fused-src/gtest/gtest.h
index ebb16db7b..2d82d8e4d 100644
--- a/third-party/gtest-1.8.1/fused-src/gtest/gtest.h
+++ b/third-party/gtest-1.8.1/fused-src/gtest/gtest.h
@@ -53,6 +53,7 @@
#define GTEST_INCLUDE_GTEST_GTEST_H_
#include <limits>
+#include <memory>
#include <ostream>
#include <vector>
@@ -2442,6 +2443,10 @@ GTEST_API_ bool IsTrue(bool condition);
// Defines scoped_ptr.
+// RocksDB: use unique_ptr to work around some clang-analyze false reports
+template <typename T>
+using scoped_ptr = std::unique_ptr<T>;
+/*
// This implementation of scoped_ptr is PARTIAL - it only contains
// enough stuff to satisfy Google Test's need.
template <typename T>
@@ -2481,6 +2486,7 @@ class scoped_ptr {
GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
};
+*/
// Defines RE.