[mips] Implement GetWriteFlag() for mips
authorPetar Jovanovic <petar.jovanovic@mips.com>
Wed, 25 Apr 2018 16:21:00 +0000 (16:21 +0000)
committerPetar Jovanovic <petar.jovanovic@mips.com>
Wed, 25 Apr 2018 16:21:00 +0000 (16:21 +0000)
commit1dd3584ec06d034aaf897edec30b3adb4cb2df25
tree5d24ed82727f3b10d553458279a71e2e985b0567
parentf3e043f67b64f16087a3456f618d9bac29dfc992
[mips] Implement GetWriteFlag() for mips

The read/write flag is set by manually decoding the instruction that caused
the exception. It is implemented this way because the cause register which
contains the needed flag was removed from the signal context structure which
the user handler receives from the kernel.

Patch by Milos Stojanovic.

Differential Revision: https://reviews.llvm.org/D45768

llvm-svn: 330840
compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
compiler-rt/test/sanitizer_common/TestCases/Posix/illegal_read_test.cc [new file with mode: 0644]
compiler-rt/test/sanitizer_common/TestCases/Posix/illegal_write_test.cc [new file with mode: 0644]