Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common fix for...



details:   https://anonhg.NetBSD.org/src/rev/b811aa09aa5d
branches:  trunk
changeset: 938344:b811aa09aa5d
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Sep 07 00:22:51 2020 +0000

description:
fix for netbsd/mips.

diffstat:

 external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc |  7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diffs (32 lines):

diff -r 6340536dff91 -r b811aa09aa5d external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
--- a/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc   Mon Sep 07 00:19:04 2020 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc   Mon Sep 07 00:22:51 2020 +0000
@@ -33,6 +33,7 @@
 // format. Struct kernel_stat is defined as 'struct stat' in asm/stat.h. To
 // access stat from asm/stat.h, without conflicting with definition in
 // sys/stat.h, we use this trick.
+#if SANITIZER_LINUX
 #if defined(__mips64)
 #include <asm/unistd.h>
 #include <sys/types.h>
@@ -40,6 +41,7 @@
 #include <asm/stat.h>
 #undef stat
 #endif
+#endif
 
 #if SANITIZER_NETBSD
 #include <lwp.h>
@@ -1848,7 +1850,12 @@
   uint32_t faulty_instruction;
   uint32_t op_code;
 
+#if SANITIZER_NETBSD
+  ucontext_t *nucontext = (ucontext_t *)ucontext;
+  exception_source = (uint32_t *)_UC_MACHINE_PC(nucontext);
+#else
   exception_source = (uint32_t *)ucontext->uc_mcontext.pc;
+#endif
   faulty_instruction = (uint32_t)(*exception_source);
 
   op_code = (faulty_instruction >> 26) & 0x3f;



Home | Main Index | Thread Index | Old Index