Parcourir la source

DynamicLoader: Fix compiler warning

math.cpp: In function 'int64_t __moddi3(int64_t, int64_t)':
math.cpp:168:13: error: 'r' may be used uninitialized
[-Werror=maybe-uninitialized]
  168 |     return ((int64_t)r ^ s) - s; // negate if s == -1
      |             ^~~~~~~~~~
Gunnar Beutner il y a 4 ans
Parent
commit
824bfa9600
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      Userland/DynamicLoader/math.cpp

+ 1 - 1
Userland/DynamicLoader/math.cpp

@@ -163,7 +163,7 @@ int64_t __moddi3(int64_t a, int64_t b)
     b = (b ^ s) - s;                   // negate if s == -1
     b = (b ^ s) - s;                   // negate if s == -1
     s = a >> bits_in_dword_m1;         // s = a < 0 ? -1 : 0
     s = a >> bits_in_dword_m1;         // s = a < 0 ? -1 : 0
     a = (a ^ s) - s;                   // negate if s == -1
     a = (a ^ s) - s;                   // negate if s == -1
-    uint64_t r;
+    uint64_t r = 0;
     __udivmoddi4(a, b, &r);
     __udivmoddi4(a, b, &r);
     return ((int64_t)r ^ s) - s; // negate if s == -1
     return ((int64_t)r ^ s) - s; // negate if s == -1
 }
 }