File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
compiler-rt/lib/sanitizer_common Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -2018,6 +2018,18 @@ SignalContext::WriteFlag SignalContext::GetWriteFlag() const {
20182018 return Unknown;
20192019 return esr & ESR_ELx_WNR ? Write : Read;
20202020# elif defined(__loongarch__)
2021+ // In the musl environment, the Linux kernel uapi sigcontext.h is not
2022+ // included in signal.h. To avoid missing the SC_ADDRERR_{RD,WR} macros,
2023+ // copy them here. The LoongArch Linux kernel uapi is already stable,
2024+ // so there's no need to worry about the value changing.
2025+ # ifndef SC_ADDRERR_RD
2026+ // Address error was due to memory load
2027+ # define SC_ADDRERR_RD (1 << 30 )
2028+ # endif
2029+ # ifndef SC_ADDRERR_WR
2030+ // Address error was due to memory store
2031+ # define SC_ADDRERR_WR (1 << 31 )
2032+ # endif
20212033 u32 flags = ucontext->uc_mcontext .__flags ;
20222034 if (flags & SC_ADDRERR_RD)
20232035 return SignalContext::Read;
You can’t perform that action at this time.
0 commit comments