Преглед изворни кода

Fix crash on RHEL-based distros.

Looks like GCC (4.4.x) on RHEL is built with some optimization flags, which caused crash inside assembler code (when using inline-cast: uint->uchar->uint from GetNzbSubID down to find_maskwidth).
Tested this change on 7 different distros, so far - everything seems to be working.
bank пре 13 година
родитељ
комит
0ebafa695c
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      Engine/source/platform/platformCPUCount.cpp

+ 3 - 3
Engine/source/platform/platformCPUCount.cpp

@@ -522,9 +522,9 @@ next:
                // processors per core
                // processors per core
 
 
                tblSMTID[j]  = GetNzbSubID(apicID, MaxLPPerCore, 0);
                tblSMTID[j]  = GetNzbSubID(apicID, MaxLPPerCore, 0);
-               tblCoreID[j] = GetNzbSubID(apicID, 
-                  MaxCorePerPhysicalProc(),
-                  (unsigned char) find_maskwidth(MaxLPPerCore));
+               unsigned char maxCorePPP = MaxCorePerPhysicalProc();
+               unsigned char maskWidth = find_maskwidth(MaxLPPerCore);
+               tblCoreID[j] = GetNzbSubID(apicID, maxCorePPP, maskWidth);
 
 
                // Extract package ID, assume single cluster.
                // Extract package ID, assume single cluster.
                // Shift value is the mask width for max Logical per package
                // Shift value is the mask width for max Logical per package