Fix ArgumentOutOfRangeExecption with 0xffff parameters #977
Loading…
Reference in a new issue
No description provided.
Delete branch "Unity-Technologies/proper-param0xffff-fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR fixes #913 and improves the original unmerged fix in PR #914.
The fix provided in PR #914 is insufficient in certain cases due to this condition:
current_index + 1 == current_table.LengthThe above condition causes the fix to apply only when the overflow is on the second-to-last row of the method metadata table. But if there are additional parameterless methods at the end of the table, the parameter metadata table does not grow together with the method table. This causes the overflow to occur further from the end of the table.
The fix is simple: remove the above condition altogether. This is safe because
next_indexcan never be 0 when the parameters table is exactly0xffff.Note that the same issue also applies to
dnlib, as it also checks fortableSourceRid + 1 == tableSource.Rows.I added a test which uses the same module as param0xffff.dll, but adds a couple of extra parameterless methods on top, which move the overflow away from the second-to-last row.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.