[Lldb-commits] [lldb] 99a0566 - [lldb][test] Avoid UB in optimized_code test

Arthur Eubanks via lldb-commits lldb-commits at lists.llvm.org
Sun Nov 13 14:22:08 PST 2022


Author: Arthur Eubanks
Date: 2022-11-13T14:21:55-08:00
New Revision: 99a05667217162029d1de84d4a49d041c06be175

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

LOG: [lldb][test] Avoid UB in optimized_code test

Added: 
    

Modified: 
    lldb/test/API/functionalities/optimized_code/main.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/functionalities/optimized_code/main.cpp b/lldb/test/API/functionalities/optimized_code/main.cpp
index f1beaf3020d50..b318a92dfae84 100644
--- a/lldb/test/API/functionalities/optimized_code/main.cpp
+++ b/lldb/test/API/functionalities/optimized_code/main.cpp
@@ -11,8 +11,9 @@ struct S1 {
 };
 
 struct S2 {
-  char a, b;
-  int pad;
+  char a = 0;
+  char b = 0;
+  int pad = 0;
   S2(int x) {
     a = x & 0xff;
     b = x & 0xff00;


        


More information about the lldb-commits mailing list