Skip to content

Commit 8982f98

Browse files
authored
[NFC][sanitizer] Remove else if from ThreadDescriptorSizeFallback (#108909)
1 parent fab60a6 commit 8982f98

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -259,26 +259,26 @@ static uptr ThreadDescriptorSizeFallback() {
259259
if (SANITIZER_X32)
260260
return 1728; // Assume only one particular version for x32.
261261
// For ARM sizeof(struct pthread) changed in Glibc 2.23.
262-
else if (SANITIZER_ARM)
262+
if (SANITIZER_ARM)
263263
return minor <= 22 ? 1120 : 1216;
264-
else if (minor <= 3)
264+
if (minor <= 3)
265265
return FIRST_32_SECOND_64(1104, 1696);
266-
else if (minor == 4)
266+
if (minor == 4)
267267
return FIRST_32_SECOND_64(1120, 1728);
268-
else if (minor == 5)
268+
if (minor == 5)
269269
return FIRST_32_SECOND_64(1136, 1728);
270-
else if (minor <= 9)
270+
if (minor <= 9)
271271
return FIRST_32_SECOND_64(1136, 1712);
272-
else if (minor == 10)
272+
if (minor == 10)
273273
return FIRST_32_SECOND_64(1168, 1776);
274-
else if (minor == 11 || (minor == 12 && patch == 1))
274+
if (minor == 11 || (minor == 12 && patch == 1))
275275
return FIRST_32_SECOND_64(1168, 2288);
276-
else if (minor <= 14)
276+
if (minor <= 14)
277277
return FIRST_32_SECOND_64(1168, 2304);
278-
else if (minor < 32) // Unknown version
278+
if (minor < 32) // Unknown version
279279
return FIRST_32_SECOND_64(1216, 2304);
280-
else // minor == 32
281-
return FIRST_32_SECOND_64(1344, 2496);
280+
// minor == 32
281+
return FIRST_32_SECOND_64(1344, 2496);
282282
}
283283
return 0;
284284
# elif defined(__s390__) || defined(__sparc__)
@@ -302,10 +302,9 @@ static uptr ThreadDescriptorSizeFallback() {
302302
// glibc version
303303
if (minor <= 28) // WARNING: the highest tested version is 2.29
304304
return 1772; // no guarantees for this one
305-
else if (minor <= 31)
305+
if (minor <= 31)
306306
return 1772; // tested against glibc 2.29, 2.31
307-
else
308-
return 1936; // tested against glibc 2.32
307+
return 1936; // tested against glibc 2.32
309308
}
310309
return 0;
311310
# elif defined(__aarch64__)

0 commit comments

Comments
 (0)