[compiler-rt] initialize variables to silence warning. NFC.
authorTim Northover <tnorthover@apple.com>
Wed, 1 Feb 2023 12:17:39 +0000 (12:17 +0000)
committerTim Northover <tnorthover@apple.com>
Wed, 1 Feb 2023 13:30:10 +0000 (13:30 +0000)
They were being initialized anyway, I believe, but the logic was a bit
convoluted for the Clang warnings to detect so we were getting "variable 'EBX'
may be uninitialized when used here" later on.

compiler-rt/lib/builtins/cpu_model.c

index c5d7ae3..4e3ce7a 100644 (file)
@@ -646,7 +646,7 @@ getAMDProcessorTypeAndSubtype(unsigned Family, unsigned Model,
 
 static void getAvailableFeatures(unsigned ECX, unsigned EDX, unsigned MaxLeaf,
                                  unsigned *Features) {
-  unsigned EAX, EBX;
+  unsigned EAX = 0, EBX = 0;
 
 #define setFeature(F)                                                          \
   Features[F / 32] |= 1U << (F % 32)