aboutsummaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_linux_libcdep.cc
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-02-21 13:53:12 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-02-21 13:53:12 +0000
commitc003a57e2e4a1ad9be0338806bc1038b6987155f (patch)
treecf295e125457815f2b478811e8414810b8ed7c14 /lib/sanitizer_common/sanitizer_linux_libcdep.cc
parent48f79c11890f23f47fbe89ec54a57d5cd485a7b1 (diff)
downloadsrc-c003a57e2e4a1ad9be0338806bc1038b6987155f.tar.gz
src-c003a57e2e4a1ad9be0338806bc1038b6987155f.zip
Notes
Notes: svn path=/vendor/compiler-rt/dist/; revision=295850 svn path=/vendor/compiler-rt/compiler-rt-release_380-r262564/; revision=296362; tag=vendor/compiler-rt/compiler-rt-release_380-r262564
Diffstat (limited to 'lib/sanitizer_common/sanitizer_linux_libcdep.cc')
-rw-r--r--lib/sanitizer_common/sanitizer_linux_libcdep.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/sanitizer_common/sanitizer_linux_libcdep.cc b/lib/sanitizer_common/sanitizer_linux_libcdep.cc
index 8cf2c73b1d53..04031d25528c 100644
--- a/lib/sanitizer_common/sanitizer_linux_libcdep.cc
+++ b/lib/sanitizer_common/sanitizer_linux_libcdep.cc
@@ -222,6 +222,11 @@ uptr ThreadDescriptorSize() {
char *end;
int minor = internal_simple_strtoll(buf + 8, &end, 10);
if (end != buf + 8 && (*end == '\0' || *end == '.')) {
+ int patch = 0;
+ if (*end == '.')
+ // strtoll will return 0 if no valid conversion could be performed
+ patch = internal_simple_strtoll(end + 1, nullptr, 10);
+
/* sizeof(struct pthread) values from various glibc versions. */
if (SANITIZER_X32)
val = 1728; // Assume only one particular version for x32.
@@ -235,9 +240,9 @@ uptr ThreadDescriptorSize() {
val = FIRST_32_SECOND_64(1136, 1712);
else if (minor == 10)
val = FIRST_32_SECOND_64(1168, 1776);
- else if (minor <= 12)
+ else if (minor == 11 || (minor == 12 && patch == 1))
val = FIRST_32_SECOND_64(1168, 2288);
- else if (minor == 13)
+ else if (minor <= 13)
val = FIRST_32_SECOND_64(1168, 2304);
else
val = FIRST_32_SECOND_64(1216, 2304);