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 /thread_local_alloc.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 'thread_local_alloc.c')
-rw-r--r-- | thread_local_alloc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/thread_local_alloc.c b/thread_local_alloc.c index e97d34dc..4aae5c9f 100644 --- a/thread_local_alloc.c +++ b/thread_local_alloc.c @@ -93,17 +93,19 @@ static void return_freelists(void **fl, void **gfl) /* This call must be made from the new thread. */ GC_INNER void GC_init_thread_local(GC_tlfs p) { - int i, j; + int i, j, res; GC_ASSERT(I_HOLD_LOCK()); if (!EXPECT(keys_initialized, TRUE)) { GC_ASSERT((word)&GC_thread_key % sizeof(word) == 0); - if (0 != GC_key_create(&GC_thread_key, reset_thread_key)) { + res = GC_key_create(&GC_thread_key, reset_thread_key); + if (COVERT_DATAFLOW(res) != 0) { ABORT("Failed to create key for local allocator"); } keys_initialized = TRUE; } - if (0 != GC_setspecific(GC_thread_key, p)) { + res = GC_setspecific(GC_thread_key, p); + if (COVERT_DATAFLOW(res) != 0) { ABORT("Failed to set thread specific allocation pointers"); } for (j = 0; j < TINY_FREELISTS; ++j) { |