OSDN Git Service

Merging r367662:
authorHans Wennborg <hans@hanshq.net>
Mon, 5 Aug 2019 09:02:29 +0000 (09:02 +0000)
committerHans Wennborg <hans@hanshq.net>
Mon, 5 Aug 2019 09:02:29 +0000 (09:02 +0000)
------------------------------------------------------------------------
r367662 | psmith | 2019-08-02 10:05:14 +0200 (Fri, 02 Aug 2019) | 17 lines

[AliasAnalysis] Initialize a member variable that may be used by unit test.

The unit tests in BasicAliasAnalysisTest use the alias analysis API
directly and do not call setAAResults to initalize AAR. This gives a
valgrind error "Conditional Jump depends on unitialized variable".

On most buildbots the variable is nullptr, but in some cases it can be
non nullptr leading to seemingly random failures.

These tests were disabled in r366986. With the initialization they can be
enabled again.

Fixes PR42719

Differential Revision: https://reviews.llvm.org/D65568

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@367818 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/AliasAnalysis.h

index 9483415..282142f 100644 (file)
@@ -949,7 +949,7 @@ template <typename DerivedT> class AAResultBase {
 
   /// A pointer to the AAResults object that this AAResult is
   /// aggregated within. May be null if not aggregated.
-  AAResults *AAR;
+  AAResults *AAR = nullptr;
 
   /// Helper to dispatch calls back through the derived type.
   DerivedT &derived() { return static_cast<DerivedT &>(*this); }