]> granicus.if.org Git - gc/commitdiff
Add assertion in GC_getspecific on qtid
authorIvan Maidanski <ivmai@mail.ru>
Sat, 21 Apr 2012 19:51:41 +0000 (23:51 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Sat, 21 Apr 2012 19:51:41 +0000 (23:51 +0400)
* include/private/specific.h (GC_getspecific): Add assertion on "qtid"
value.

include/private/specific.h

index 7648f2c199d9313057f40da0ce6dea4828c1d625..7302fe32ca98cbbe28c0485ad39a77b21aebcf08 100644 (file)
@@ -88,6 +88,8 @@ GC_INLINE void * GC_getspecific(tsd * key)
     word qtid = quick_thread_id();
     tse * volatile * entry_ptr = &key->cache[CACHE_HASH(qtid)];
     tse * entry = *entry_ptr;   /* Must be loaded only once.    */
+
+    GC_ASSERT(qtid != INVALID_QTID);
     if (EXPECT(entry -> qtid == qtid, TRUE)) {
       GC_ASSERT(entry -> thread == pthread_self());
       return entry -> value;