+2017-04-05 Jakub Jelinek <jakub@redhat.com>
+ Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ PR sanitizer/80308
+ * asan.c (asan_store_shadow_bytes): Fix location of last_chunk_value
+ for big endian.
+
2017-04-05 Eric Botcazou <ebotcazou@adacore.com>
PR target/78002
unsigned char c = (char) is_clobber ? ASAN_STACK_MAGIC_USE_AFTER_SCOPE : 0;
unsigned HOST_WIDE_INT val = 0;
+ unsigned last_pos = size;
+ if (last_chunk_size && !is_clobber)
+ last_pos = BYTES_BIG_ENDIAN ? 0 : size - 1;
for (unsigned i = 0; i < size; ++i)
{
unsigned char shadow_c = c;
- if (i == size - 1 && last_chunk_size && !is_clobber)
+ if (i == last_pos)
shadow_c = last_chunk_size;
val |= (unsigned HOST_WIDE_INT) shadow_c << (BITS_PER_UNIT * i);
}
+2017-04-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/80308
+ * c-c++-common/asan/pr80308.c: New test.
+
2017-04-05 Dominik Vogt <vogt@linux.vnet.ibm.com>
PR target/79890
--- /dev/null
+/* PR sanitizer/80308 */
+/* { dg-do run } */
+
+__attribute__((noinline, noclone)) int
+foo (char *a)
+{
+ int i, j = 0;
+ asm volatile ("" : "+r" (a) : : "memory");
+ for (i = 0; i < 12; i++)
+ j += a[i];
+ return j;
+}
+
+int
+main ()
+{
+ int i, j = 0;
+ for (i = 0; i < 4; i++)
+ {
+ char a[12];
+ __builtin_memset (a, 0, sizeof (a));
+ j += foo (a);
+ }
+ return j;
+}