Open dy-dx opened 10 years ago
This happens because CUtlHashFast<>::RemoveAll()
calls CUtlVector<>::RemoveAll()
which sets the internal CUtlVector allocated memory to 0xDD to clear it after it destructs it.
Then CUtlHashFast<>::FastInsert()
calls CUtlFixedLinkedList<>::LinkBefore
, which tries to compare the internal CUtlVector memory to 0 to see if it is valid or not, but the value of the memory will be 0xDD, which is seen as valid, then caught by an assert when it isn't actually valid.
CUtlVector coder used 0xDD to signify destructed memory for the vector class (platform.h Desctruct() method coder did this also) in debug builds. CUtlHashFast coder didn't take this into account when giving vector memory to the CUtlFixedLinkedList class which also doesn't take the 0xDD into account.
Issue from Jul 17, 2013
REPRO STEPS: create CUtlHashFast<> object call CUtlHashFast<>::RemoveAll() call CUtlHashFast<>::FastInsert()
HAPPENS ONLY ON DEBUG BUILDS