Skip to content

Commit 735ed57

Browse files
author
git apple-llvm automerger
committed
Merge commit '993555beb8ff' from llvm.org/main into next
2 parents 9bccbca + 993555b commit 735ed57

File tree

1 file changed

+4
-3
lines changed
  • compiler-rt/lib/scudo/standalone

1 file changed

+4
-3
lines changed

compiler-rt/lib/scudo/standalone/memtag.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,10 @@ inline bool systemDetectsMemoryTagFaultsTestOnly() {
9191
#ifndef PR_MTE_TCF_MASK
9292
#define PR_MTE_TCF_MASK (3UL << PR_MTE_TCF_SHIFT)
9393
#endif
94-
return (static_cast<unsigned long>(
95-
prctl(PR_GET_TAGGED_ADDR_CTRL, 0, 0, 0, 0)) &
96-
PR_MTE_TCF_MASK) != PR_MTE_TCF_NONE;
94+
int res = prctl(PR_GET_TAGGED_ADDR_CTRL, 0, 0, 0, 0);
95+
if (res == -1)
96+
return false;
97+
return (static_cast<unsigned long>(res) & PR_MTE_TCF_MASK) != PR_MTE_TCF_NONE;
9798
}
9899

99100
inline void enableSystemMemoryTaggingTestOnly() {

0 commit comments

Comments
 (0)