Branch Coverage

/usr/local/lib/perl5/site_perl/5.26.1/x86_64-linux/XS/libpanda.x/i/panda/cast.h
Criterion Covered Total %
branch 12 22 54.5


line true false branch
16 17 299 if (!map) {
17 17 0 thread_local struct { DynCastCacheMap map; } wrp;
32 0 316 if (!obj) return NULL;
34 316 0 intptr_t key = (intptr_t)typeid(*obj).name();
37 316 0 DynCastCacheMap::iterator it = map.find(key);
38 299 17 if (it != map.end())
39 299 0 return it->second != INCORRECT_PTRDIFF ? reinterpret_cast((char*)obj - it->second) : NULL;
40 0 17 DERIVED* ret = dynamic_cast(obj);
41 17 0 if (ret) map[key] = (char*)obj - (char*)ret;
17 0 if (ret) map[key] = (char*)obj - (char*)ret;
42 0 0 else map[key] = INCORRECT_PTRDIFF;