fix_msan.patch 895 B

1234567891011121314151617181920212223242526272829
  1. diff --git a/kmp_utility.cpp b/kmp_utility.cpp
  2. index c4bfead..c755788 100644
  3. --- a/kmp_utility.cpp
  4. +++ b/kmp_utility.cpp
  5. @@ -16,6 +16,10 @@
  6. #include "kmp_wrapper_getpid.h"
  7. #include <float.h>
  8. +#include <util/system/types.h>
  9. +
  10. +const char* CpuBrand(ui32 store[12]) noexcept; //defined in <util/system/cpu_id.h>
  11. +
  12. static const char *unknown = "unknown";
  13. #if KMP_ARCH_X86 || KMP_ARCH_X86_64
  14. @@ -260,12 +264,9 @@ void __kmp_query_cpuid(kmp_cpuinfo_t *p) {
  15. { // Parse CPU brand string for frequency, saving the string for later.
  16. int i;
  17. - kmp_cpuid_t *base = (kmp_cpuid_t *)&p->name[0];
  18. // Get CPU brand string.
  19. - for (i = 0; i < 3; ++i) {
  20. - __kmp_x86_cpuid(0x80000002 + i, 0, base + i);
  21. - }
  22. + CpuBrand((ui32 *)&p->name[0]);
  23. p->name[sizeof(p->name) - 1] = 0; // Just in case. ;-)
  24. KA_TRACE(trace_level, ("cpu brand string: \"%s\"\n", &p->name[0]));