about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLiubov Dmitrieva <liubov.dmitrieva@intel.com>2013-03-11 17:06:38 +0400
committerLiubov Dmitrieva <ldmitrie@sourceware.org>2013-10-23 19:07:36 +0400
commit7f5505c12769e739442d52bf29903f93ff2322c2 (patch)
tree9c7c51e50b88b5cbac8018c76d369c8ec45ca6ea
parent9c9cc287b7b0c55e2dcf17919d733c9db9aa8d64 (diff)
downloadglibc-7f5505c12769e739442d52bf29903f93ff2322c2.tar.gz
glibc-7f5505c12769e739442d52bf29903f93ff2322c2.tar.xz
glibc-7f5505c12769e739442d52bf29903f93ff2322c2.zip
Inappropriate code style for Intel MPX in debug/wcpcpy_chk. Fix the code if MPX is enabled.
-rw-r--r--debug/wcpcpy_chk.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/debug/wcpcpy_chk.c b/debug/wcpcpy_chk.c
index 7c836e6bfb..d90f293c4a 100644
--- a/debug/wcpcpy_chk.c
+++ b/debug/wcpcpy_chk.c
@@ -26,6 +26,7 @@
    DEST.  Check for overflows.  */
 wchar_t *
 __wcpcpy_chk (wchar_t *dest, const wchar_t *src, size_t destlen)
+#ifndef __CHKP__
 {
   wchar_t *wcp = (wchar_t *) dest - 1;
   wint_t c;
@@ -42,3 +43,21 @@ __wcpcpy_chk (wchar_t *dest, const wchar_t *src, size_t destlen)
 
   return wcp;
 }
+#else
+{
+  dest--;
+  wint_t c;
+
+  do
+    {
+      if (__builtin_expect (destlen-- == 0, 0))
+	__chk_fail ();
+      c = src[0];
+      *++dest = c;
+      ++src;
+    }
+  while (c != L'\0');
+
+  return dest;
+}
+#endif