@@ -292,19 +292,18 @@ void __typeart_leave_scope_omp(int alloca_count) {
292292void __typeart_alloc_mty (const void * addr, const void * info, size_t count) {
293293 TYPEART_RUNTIME_GUARD;
294294 const void * retAddr = __builtin_return_address (0 );
295+ const auto type_id = reinterpret_cast <const typeart::GlobalTypeInfo*>(info)->type_id ;
295296 auto & rt = typeart::RuntimeSystem::get ();
296- const auto type_id = rt.type_translator ().get_type_id_for (info);
297+ assert ( type_id == rt.type_translator ().get_type_id_for (info) && " Type ID of global and lookup must match " );
297298 rt.allocation_tracker ().onAlloc (addr, type_id, count, retAddr);
298299}
299300
300301void __typeart_alloc_stack_mty (const void * addr, const void * info, size_t count) {
301302 TYPEART_RUNTIME_GUARD;
302303 const void * retAddr = __builtin_return_address (0 );
303-
304- const auto type_id = reinterpret_cast <const typeart::GlobalTypeInfo*>(info)->type_id ;
305- auto & rt = typeart::RuntimeSystem::get ();
306- // auto stored_id = rt.type_translator().get_type_id_for(info);
307- // LOG_FATAL(type_id << " vs. " << stored_id)
304+ const auto type_id = reinterpret_cast <const typeart::GlobalTypeInfo*>(info)->type_id ;
305+ auto & rt = typeart::RuntimeSystem::get ();
306+ assert (type_id == rt.type_translator ().get_type_id_for (info) && " Type ID of global and lookup must match" );
308307 rt.allocation_tracker ().onAllocStack (addr, type_id, count, retAddr);
309308}
310309
@@ -313,6 +312,7 @@ void __typeart_alloc_global_mty(const void* addr, const void* info, size_t count
313312 const void * retAddr = __builtin_return_address (0 );
314313 const auto type_id = reinterpret_cast <const typeart::GlobalTypeInfo*>(info)->type_id ;
315314 auto & rt = typeart::RuntimeSystem::get ();
315+ assert (type_id == rt.type_translator ().get_type_id_for (info) && " Type ID of global and lookup must match" );
316316 rt.allocation_tracker ().onAllocGlobal (addr, type_id, count, retAddr);
317317}
318318
@@ -321,6 +321,7 @@ void __typeart_alloc_omp_mty(const void* addr, const void* info, size_t count) {
321321 const void * retAddr = __builtin_return_address (0 );
322322 const auto type_id = reinterpret_cast <const typeart::GlobalTypeInfo*>(info)->type_id ;
323323 auto & rt = typeart::RuntimeSystem::get ();
324+ assert (type_id == rt.type_translator ().get_type_id_for (info) && " Type ID of global and lookup must match" );
324325 rt.allocation_tracker ().onAlloc (addr, type_id, count, retAddr);
325326}
326327
@@ -329,5 +330,6 @@ void __typeart_alloc_stack_omp_mty(const void* addr, const void* info, size_t co
329330 const void * retAddr = __builtin_return_address (0 );
330331 const auto type_id = reinterpret_cast <const typeart::GlobalTypeInfo*>(info)->type_id ;
331332 auto & rt = typeart::RuntimeSystem::get ();
333+ assert (type_id == rt.type_translator ().get_type_id_for (info) && " Type ID of global and lookup must match" );
332334 rt.allocation_tracker ().onAllocStack (addr, type_id, count, retAddr);
333335}
0 commit comments