mirror of
https://github.com/hyprwm/hyprutils.git
synced 2024-11-17 09:35:58 +01:00
7e1b6610a2
* sharedptr: dont downcast ptr implentation avoid runtime errors of wrong downcasts by adding a underlaying ptr data getter and only cast the data, downcasting the implentation type isnt inherited from eachother, while the intention was do upcast/downcast a derived class to a base class. found with UBSAN "runtime error: downcast of address which does not point to an object of type "CSharedPointer_::impl<IKeyboard>" note: object is of type "Hyprutils::Memory::CSharedPointer_::impl<CKeyboard>" also make dataNonNull check against != nullptr. * sharedptr: use reinterpret_cast instead of c style make it more type safe, C style casts tries every single one until one works, or not. compilers also produces better warnings/errors when using c++ casts in favour of C style ones. |
||
---|---|---|
.. | ||
hyprutils |