Port better to AddressSanitizer.
commit3517da701ea5d16c296745d6678988b06bee615d
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 30 Nov 2014 07:30:22 +0000 (29 23:30 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 30 Nov 2014 07:32:29 +0000 (29 23:32 -0800)
treeaa890d2a3915c69ce9a6a41714bc8cad9c6c3b70
parent70723e5107fd92c31e5b395d58be0b20b13c322d
Port better to AddressSanitizer.

These changes suffice for temacs on x86-64 with GCC 4.9.2 and
-fsanitize=address.
* alloc.c (valid_pointer_p) [ADDRESS_SANITIZER]:
Return -1 or 0, as the pipe trick doesn't work.
* alloc.c (relocatable_string_data_p, mark_object, sweep_symbols):
* data.c (Ffset):
* print.c (print_object):
When a pointer-check primitive returns -1, do not assume this
means the pointer is valid or that the underlying system has failed.
It could just be that addresses are being sanitized so Emacs can't
test for pointer validity.
* lisp.h (defined_GC_CHECK_STRING_BYTES): New constant.
(USE_STACK_STRING) [GC_CHECK_STRING_BYTES]: Now false, since the
string validity checker doesn't work on stack-based strings.
src/ChangeLog
src/alloc.c
src/data.c
src/lisp.h
src/print.c