diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2016-04-07 20:26:28 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2016-04-07 20:26:28 +0000 |
commit | eb37fcbc875d6aea445b187ec8871b842fb06a4a (patch) | |
tree | 2d35ac0eff2a07f5fc64d2adecbd43d65daac9ad /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 87b30a0ef27ecc9be69d13379e105f8b05548fd0 (diff) | |
download | bcm5719-llvm-eb37fcbc875d6aea445b187ec8871b842fb06a4a.tar.gz bcm5719-llvm-eb37fcbc875d6aea445b187ec8871b842fb06a4a.zip |
[sanitizer] Fix sem_init_glibc.cc test on __HAVE_64B_ATOMIC arches.
glibc can use one of 2 layouts for semaphores: architectures that
don't HAVE_64B_ATOMIC use an uint32_t field with semaphore value,
then a private field, then a waiting thread count field - this is
the layout currently assumed by the test. However, HAVE_64B_ATOMIC
arches use a fused uint64_t field that contains the value in low bits
and waiting thread count in high bits, followed by a private field.
This resulted in taking private field from the wrong offset on 64-bit
atomic platforms (the test still passed, but didn't actually test
the private field). On big-endian platforms, this resulted in a fail,
since the first 4 bytes overlay the thread count field, and not
the value field.
Found while porting ASan to s390x.
Patch by Marcin KoĆcielnicki.
llvm-svn: 265715
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions