[llvm] 4d06565 - Initialize SaveInfo in methods Output::preflightKey and Output::preflightElement.

Kevin Athey via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 5 13:13:52 PST 2022


Author: Kevin Athey
Date: 2022-01-05T13:13:48-08:00
New Revision: 4d06565bd81c7f3ce11f975b765b045a3f84696c

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

LOG: Initialize SaveInfo in methods Output::preflightKey and Output::preflightElement.

When enabling MSAN eager mode with noundef analysis these variables were found to not be initialized in unit tests.

Reviewed By: vitalybuka

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

Added: 
    

Modified: 
    llvm/lib/Support/YAMLTraits.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/YAMLTraits.cpp b/llvm/lib/Support/YAMLTraits.cpp
index aa6163a761614..10ff020ad972f 100644
--- a/llvm/lib/Support/YAMLTraits.cpp
+++ b/llvm/lib/Support/YAMLTraits.cpp
@@ -527,8 +527,9 @@ std::vector<StringRef> Output::keys() {
 }
 
 bool Output::preflightKey(const char *Key, bool Required, bool SameAsDefault,
-                          bool &UseDefault, void *&) {
+                          bool &UseDefault, void *&SaveInfo) {
   UseDefault = false;
+  SaveInfo = nullptr;
   if (Required || !SameAsDefault || WriteDefaultValues) {
     auto State = StateStack.back();
     if (State == inFlowMapFirstKey || State == inFlowMapOtherKey) {
@@ -599,7 +600,8 @@ void Output::endSequence() {
   StateStack.pop_back();
 }
 
-bool Output::preflightElement(unsigned, void *&) {
+bool Output::preflightElement(unsigned, void *&SaveInfo) {
+  SaveInfo = nullptr;
   return true;
 }
 


        


More information about the llvm-commits mailing list