Skip to content

Commit

Permalink
Add code to tolerate sloppy code of libgomp.
Browse files Browse the repository at this point in the history
  • Loading branch information
kai1970 committed Sep 11, 2015
1 parent 09cee82 commit 628fdbf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mingw-w64-libraries/winpthreads/src/mutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,13 @@ typedef struct {
a mutex_impl_t). */
static bool
is_static_initializer(pthread_mutex_t m)
{
return (uintptr_t)m >= (uintptr_t)-3;
{
/* Treat 0 as a static initializer as well (for normal mutexes),
to tolerate sloppy code in libgomp. (We should rather fix that code!) */
intptr_t v = (intptr_t)m;
return v >= -3 && v <= 0;
/* Should be simple:
return (uintptr_t)m >= (uintptr_t)-3; */
}

/* Create and return the implementation part of a mutex from a static
Expand Down

0 comments on commit 628fdbf

Please sign in to comment.