Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/public/tier1/utlhandletable.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,11 @@ UtlHandle_t CUtlHandleTable<T, HandleBits>::CreateHandle( unsigned int nSerial,
// but that'd widen the object from 4 bytes of data to 4+4 padding, which would need profiling.
static_assert(sizeof(h) == 4);
static_assert(sizeof(UtlHandle_t) >= sizeof(h));
UtlHandle_t ret;
UtlHandle_t ret = 0;
memcpy(&ret, &h, sizeof(h));
#if defined(DBGFLAG_ASSERT) && defined(ACTUALLY_COMPILER_MSVC)
UtlHandle_t ref;
ref = *(UtlHandle_t*)&h;
Assert(ret == ref);
Assert(GetListIndex(ret) == nIndex);
Assert(GetSerialNumber(ret) == nSerial);
#endif
return ret;
#else
Expand Down