diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2017-05-23 09:23:54 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2017-05-23 09:23:54 +0300 |
commit | 0fc61f22c24537cd450e1157ee75d12929ffd6ff (patch) | |
tree | 2f1426f94119dc2570018f4bcd1e606f96b8c972 /pthread_support.c | |
parent | 36038e102f52380413c91c2c2205441c0661b6aa (diff) | |
download | bdwgc-0fc61f22c24537cd450e1157ee75d12929ffd6ff.tar.gz |
Workaround 'comparison of identical expressions' false code defects
* thread_local_alloc.c [THREAD_LOCAL_ALLOC] (GC_init_thread_local):
New local variable (res); save result of GC_setspecific and
GC_key_create to res; replace res!=0 with COVERT_DATAFLOW(res)!=0.
* pthread_support.c [CAN_HANDLE_FORK] (GC_remove_all_threads_but_me):
Likewise.
Diffstat (limited to 'pthread_support.c')
-rw-r--r-- | pthread_support.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pthread_support.c b/pthread_support.c index 7d98d925..2e0e2ee9 100644 --- a/pthread_support.c +++ b/pthread_support.c @@ -728,6 +728,8 @@ STATIC void GC_remove_all_threads_but_me(void) for (p = GC_threads[hv]; 0 != p; p = next) { next = p -> next; if (THREAD_EQUAL(p -> id, self)) { + int res; + me = p; p -> next = 0; # ifdef GC_DARWIN_THREADS @@ -744,7 +746,8 @@ STATIC void GC_remove_all_threads_but_me(void) /* we re-assign thread-local pointer to 'tlfs' for safety */ /* instead of the assertion check (again, it is OK to call */ /* GC_destroy_thread_local and GC_free_internal before). */ - if (GC_setspecific(GC_thread_key, &me->tlfs) != 0) + res = GC_setspecific(GC_thread_key, &me->tlfs); + if (COVERT_DATAFLOW(res) != 0) ABORT("GC_setspecific failed (in child)"); # endif } else { |