summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Kashkarov <m.kashkarov@partner.samsung.com>2018-05-07 19:35:33 +0300
committerMikhail Kashkarov <m.kashkarov@partner.samsung.com>2018-05-08 18:35:38 +0300
commitf1d6232f39e3c451a0f29e993df9040b0128cbd9 (patch)
treed1f9242a29f5e4679329d14dc83015ac603eb37a
parenta25e17bd53831d2478d7e3cf0e1f65b1be69d31c (diff)
downloadlinaro-gcc-f1d6232f39e3c451a0f29e993df9040b0128cbd9.tar.gz
linaro-gcc-f1d6232f39e3c451a0f29e993df9040b0128cbd9.tar.bz2
linaro-gcc-f1d6232f39e3c451a0f29e993df9040b0128cbd9.zip
Align internal representation in cow-string by 8.
COW-strings are used as an exception strings still (yet), and since char buffer starts at "this + 1" ("this" in COW basic_string<>), where "this" is properly aligned, sizeof(*this) may be not aligned by 8 (12 bytes under i686 arch with current compiler), so asan annotations will fail. Still testing with all configurations. Change-Id: Ic7bb665a58d22f7e8ab979fc548fc96973473f32
-rw-r--r--libstdc++-v3/include/bits/basic_string.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
index 7a899c16dd7..8c353771ec6 100644
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -3010,7 +3010,12 @@ _GLIBCXX_END_NAMESPACE_CXX11
size_type _M_length;
size_type _M_capacity;
_Atomic_word _M_refcount;
- };
+ }
+#ifdef _GLIBCXX_HAS_ASAN
+ __attribute__((aligned(8)));
+#else
+ ;
+#endif
struct _Rep : _Rep_base
{