projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix aliasing-based undefined behavior in string functions
[musl]
/
src
/
thread
/
pthread_mutex_consistent.c
diff --git
a/src/thread/pthread_mutex_consistent.c
b/src/thread/pthread_mutex_consistent.c
index
baea0ff
..
96b83b5
100644
(file)
--- a/
src/thread/pthread_mutex_consistent.c
+++ b/
src/thread/pthread_mutex_consistent.c
@@
-2,9
+2,9
@@
int pthread_mutex_consistent(pthread_mutex_t *m)
{
int pthread_mutex_consistent(pthread_mutex_t *m)
{
- if (
(m->_m_type & 15) < 8
) return EINVAL;
- if ((m->_m_lock & 0x
3
fffffff) != __pthread_self()->tid)
+ if (
!(m->_m_type & 8)
) return EINVAL;
+ if ((m->_m_lock & 0x
7
fffffff) != __pthread_self()->tid)
return EPERM;
return EPERM;
- m->_m_type
-= 8
;
+ m->_m_type
&= ~8U
;
return 0;
}
return 0;
}