mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-07-01 17:17:55 -05:00
fix: dynamic array reallocation for x64
This commit is contained in:
@ -189,13 +189,13 @@ bool MemberComputations::IsInRuntimeBlock() const
|
||||
return m_info->m_fast_file_block != nullptr && m_info->m_fast_file_block->m_type == FastFileBlockType::RUNTIME;
|
||||
}
|
||||
|
||||
bool MemberComputations::IsFirstMember() const
|
||||
bool MemberComputations::IsFirstUsedMember() const
|
||||
{
|
||||
const auto parentUsedMembers = StructureComputations(m_info->m_parent).GetUsedMembers();
|
||||
return !parentUsedMembers.empty() && parentUsedMembers[0] == m_info;
|
||||
}
|
||||
|
||||
bool MemberComputations::IsLastMember() const
|
||||
bool MemberComputations::IsLastUsedMember() const
|
||||
{
|
||||
const auto parentUsedMembers = StructureComputations(m_info->m_parent).GetUsedMembers();
|
||||
return !parentUsedMembers.empty() && parentUsedMembers[parentUsedMembers.size() - 1] == m_info;
|
||||
|
@ -25,8 +25,8 @@ public:
|
||||
[[nodiscard]] bool IsNotInDefaultNormalBlock() const;
|
||||
[[nodiscard]] bool IsInTempBlock() const;
|
||||
[[nodiscard]] bool IsInRuntimeBlock() const;
|
||||
[[nodiscard]] bool IsFirstMember() const;
|
||||
[[nodiscard]] bool IsLastMember() const;
|
||||
[[nodiscard]] bool IsFirstUsedMember() const;
|
||||
[[nodiscard]] bool IsLastUsedMember() const;
|
||||
[[nodiscard]] bool HasDynamicArraySize() const;
|
||||
[[nodiscard]] bool IsDynamicMember() const;
|
||||
[[nodiscard]] bool IsAfterPartialLoad() const;
|
||||
|
@ -56,6 +56,18 @@ DeclarationModifier* DeclarationModifierComputations::GetNextDeclarationModifier
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::vector<DeclarationModifier*> DeclarationModifierComputations::GetAllDeclarationModifiers() const
|
||||
{
|
||||
const auto& declarationModifiers = m_information->m_member->m_type_declaration->m_declaration_modifiers;
|
||||
std::vector<DeclarationModifier*> all;
|
||||
all.reserve(declarationModifiers.size());
|
||||
|
||||
for (const auto& mod : declarationModifiers)
|
||||
all.emplace_back(mod.get());
|
||||
|
||||
return all;
|
||||
}
|
||||
|
||||
std::vector<DeclarationModifier*> DeclarationModifierComputations::GetFollowingDeclarationModifiers() const
|
||||
{
|
||||
std::vector<DeclarationModifier*> following;
|
||||
|
@ -12,6 +12,7 @@ public:
|
||||
|
||||
[[nodiscard]] DeclarationModifier* GetDeclarationModifier() const;
|
||||
[[nodiscard]] DeclarationModifier* GetNextDeclarationModifier() const;
|
||||
[[nodiscard]] std::vector<DeclarationModifier*> GetAllDeclarationModifiers() const;
|
||||
[[nodiscard]] std::vector<DeclarationModifier*> GetFollowingDeclarationModifiers() const;
|
||||
[[nodiscard]] const std::vector<int>& GetArrayIndices() const;
|
||||
[[nodiscard]] bool IsArray() const;
|
||||
|
@ -26,6 +26,18 @@ MemberInformation* StructureComputations::GetDynamicMember() const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool StructureComputations::HasNonDynamicMember() const
|
||||
{
|
||||
for (const auto& member : m_info->m_ordered_members)
|
||||
{
|
||||
const MemberComputations memberComputations(member.get());
|
||||
if (!memberComputations.ShouldIgnore() && !memberComputations.IsAfterPartialLoad())
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<MemberInformation*> StructureComputations::GetUsedMembers() const
|
||||
{
|
||||
std::vector<MemberInformation*> members;
|
||||
|
@ -9,6 +9,7 @@ public:
|
||||
|
||||
[[nodiscard]] bool IsAsset() const;
|
||||
[[nodiscard]] MemberInformation* GetDynamicMember() const;
|
||||
[[nodiscard]] bool HasNonDynamicMember() const;
|
||||
[[nodiscard]] std::vector<MemberInformation*> GetUsedMembers() const;
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user