When having a static function that returns a new instance of some class, and using this static function call as parameter to another method, this will cause heap corruption and lead the game to segfault.
Description
Description
Details
Details
- Severity
- None
- Resolution
- Open
- Reproducibility
- N/A
- Operating System
- Windows 10 x64
- Category
- Modding
Steps To Reproduce
Code example:
class MyType<Class T>: Managed { T m_Value; void MyType(T v) { m_Value = v; } } static MyType<string> CreateMyType(string s) { return new MyType<string>(s); } class MyExample { static void PrintExample(Class p) { Print(p); } }
Calling MyExample.PrintExample(CreateMyType("test")); will eventually result in a segfault (it may be necessary to call it multiple times until segfault occurs).