Skip to content

Commit

Permalink
[fix] 修复vm::GlobalMetadata中HasAttributeFromTypeRange未检查interpreter Ty…
Browse files Browse the repository at this point in the history
…peRange的bug
  • Loading branch information
pirunxi committed Apr 27, 2022
1 parent 5ac2b8a commit 8ab0f64
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

注意,此项目代码不能单独工作,甚至无法成功编译。必须配合 [huatuo](https://github.com/focus-creative-games/huatuo) 解释器才能正常工作。

main分支基于unity 2020.3.7f的代码
main分支基于unity 2020.3.33的代码
4 changes: 4 additions & 0 deletions libil2cpp/vm/GlobalMetadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,10 @@ CustomAttributesCache* il2cpp::vm::GlobalMetadata::GenerateCustomAttributesCache

static bool HasAttributeFromTypeRange(const Il2CppCustomAttributeTypeRange* typeRange, Il2CppClass* attribute)
{
if (huatuo::metadata::IsInterpreterIndex(typeRange->start))
{
return huatuo::metadata::MetadataModule::GetImageByEncodedIndex(typeRange->start)->HasAttribute(typeRange, attribute);
}
for (int32_t i = 0; i < typeRange->count; i++)
{
IL2CPP_ASSERT(typeRange->start + i < s_GlobalMetadataHeader->attributeTypesSize / (int32_t)sizeof(TypeIndex));
Expand Down

0 comments on commit 8ab0f64

Please sign in to comment.