[llvm] c674125 - [IntervalTree] Initialize find_iterator::Point

Joshua Cao via llvm-commits llvm-commits at lists.llvm.org
Sat May 13 23:44:26 PDT 2023


Author: Joshua Cao
Date: 2023-05-13T23:42:01-07:00
New Revision: c67412516edd07aeb7bed55dbf84e9ae261913b4

URL: https://github.com/llvm/llvm-project/commit/c67412516edd07aeb7bed55dbf84e9ae261913b4
DIFF: https://github.com/llvm/llvm-project/commit/c67412516edd07aeb7bed55dbf84e9ae261913b4.diff

LOG: [IntervalTree] Initialize find_iterator::Point

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

Added: 
    

Modified: 
    llvm/include/llvm/ADT/IntervalTree.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/IntervalTree.h b/llvm/include/llvm/ADT/IntervalTree.h
index f6bff70cdbdc3..cb707bd77a64d 100644
--- a/llvm/include/llvm/ADT/IntervalTree.h
+++ b/llvm/include/llvm/ADT/IntervalTree.h
@@ -463,7 +463,7 @@ class IntervalTree {
     // 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


        


More information about the llvm-commits mailing list