mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2025-01-03 11:11:14 +00:00
Add static assers to token generation
This commit is contained in:
parent
6d898acc98
commit
2949d08eb2
3 changed files with 5 additions and 3 deletions
|
@ -95,7 +95,7 @@ class KAutoObject {
|
|||
SessionRequest,
|
||||
CodeMemory, // JIT
|
||||
|
||||
FinalClassesMax = CodeMemory,
|
||||
Max = CodeMemory + 1,
|
||||
};
|
||||
|
||||
private:
|
||||
|
@ -119,8 +119,10 @@ class KAutoObject {
|
|||
if constexpr (std::is_same_v<T, KAutoObject>) {
|
||||
return 0;
|
||||
} else if constexpr (!std::is_final_v<T>) {
|
||||
static_assert(T::typeId >= TypeId::SynchronizationObject && T::typeId < TypeId::FinalClassesMin, "Invalid type ID!");
|
||||
return (1 << ((ushort)T::typeId - 1)) | GenerateClassToken<typename T::BaseClass>();
|
||||
} else {
|
||||
static_assert(T::typeId >= TypeId::FinalClassesMin && T::typeId < TypeId::Max, "Invalid type ID!");
|
||||
ushort off = (ushort)T::typeId - (ushort)TypeId::FinalClassesMin;
|
||||
return ((ushort)detail::A038444(off) << 9) | 0x100u | GenerateClassToken<typename T::BaseClass>();
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ class KResourceLimit;
|
|||
namespace mesosphere
|
||||
{
|
||||
|
||||
class KProcess : public KAutoObject {
|
||||
class KProcess final : public KAutoObject {
|
||||
public:
|
||||
MESOSPHERE_AUTO_OBJECT_TRAITS(AutoObject, Process);
|
||||
|
||||
|
|
Loading…
Reference in a new issue