[IntervalTree] Initialize find_iterator::Point
authorJoshua Cao <cao.joshua@yahoo.com>
Sun, 7 May 2023 05:13:16 +0000 (22:13 -0700)
committerJoshua Cao <cao.joshua@yahoo.com>
Sun, 14 May 2023 06:42:01 +0000 (23:42 -0700)
There was initially a msan report for use-of-uninitialized value due to
a bug in https://reviews.llvm.org/D138526. find_iterator::Point is
uninitialized for the default constructor of find_iterator, which is
used by IntervalTree::end. This change is not required, but its good
practice to make sure all class members are initialized.

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

llvm/include/llvm/ADT/IntervalTree.h

index f6bff70..cb707bd 100644 (file)
@@ -463,7 +463,7 @@ public:
     // Current node and index while traversing the intervals that contain
     // the reference point.
     IntervalNode *Node = nullptr;
-    PointType Point;
+    PointType Point = {};
     unsigned Index = 0;
 
     // For the current node, check if we have intervals that contain the