sys/resource.h
sys/utsname.h pwd.h utmp.h util.h
sanitizer/lsan_interface.h
- sanitizer/asan_interface.h])
+ sanitizer/asan_interface.h
+ sanitizer/common_interface_defs.h])
AC_CACHE_CHECK([for ADDR_NO_RANDOMIZE],
[emacs_cv_personality_addr_no_randomize],
int ws = sizeof (word_t);
const word_t *w1 = (const word_t *) SDATA (string1);
const word_t *w2 = (const word_t *) SDATA (string2);
- while (b < nb - ws + 1 && w1[b / ws] == w2[b / ws])
- b += ws;
+ while (b < nb - ws + 1)
+ {
+ if (UNALIGNED_LOAD_SIZE (w1, b / ws)
+ != UNALIGNED_LOAD_SIZE (w2, b / ws))
+ break;
+ b += ws;
+ }
}
/* Scan forward to the differing byte. */
}
#endif
+#if defined HAVE_SANITIZER_COMMON_INTERFACE_DEFS_H \
+ && defined ADDRESS_SANITIZER
+# include <sanitizer/common_interface_defs.h>
+# if (SIZE_MAX == UINT64_MAX)
+# define UNALIGNED_LOAD_SIZE(a, i) \
+ (size_t) __sanitizer_unaligned_load64 ((void *) ((a) + (i)))
+# elif (SIZE_MAX == UINT32_MAX)
+# define UNALIGNED_LOAD_SIZE(a, i) \
+ (size_t) __sanitizer_unaligned_load32 ((void *) ((a) + (i)))
+# else
+# define UNALIGNED_LOAD_SIZE(a, i) *((a) + (i))
+# endif
+#else
+# define UNALIGNED_LOAD_SIZE(a, i) *((a) + (i))
+#endif
+
extern void xputenv (const char *);
extern char *egetenv_internal (const char *, ptrdiff_t);