forked from jbevain/cecil
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge changes from upstream #186
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ion (jbevain#882) When all other comparisons (return type, parameters, etc.) are the same, treat instance and static methods with the same name as different methods. This corrects a problem we noticed in IL2CPP in Unity.
…vain#879) During `AssemblyReader.ReadCustomAttributes` there is a call to `WindowsRuntimeProjections.Project` ``` if (module.IsWindowsMetadata ()) foreach (var custom_attribute in custom_attributes) WindowsRuntimeProjections.Project (owner, custom_attributes, custom_attribute); ``` `WindowsRuntimeProjections.Project` would call `WindowsRuntimeProjections.HasAttribute`, which would then call `type.CustomAttributes`, which would end up back in `AssemblyReader.ReadCustomAttributes`. This would lead to a StackOverflowException. This wasn't an issue previously. My PR jbevain#843 caused this sequence of calls to start resulting in a StackOverflowException. Prior to my PR, there was a call to `metadata.RemoveCustomAttributeRange (owner);` before the call to `WindowsRuntimeProjections.Project`. This meant that when `WindowsRuntimeProjections.HasAttribute` would call `type.CustomAttributes`, we'd still end up in `AssemblyReader.ReadCustomAttributes`, however, no attributes would be found because the following if would be true and lead to returning an empty collection. ``` if (!metadata.TryGetCustomAttributeRanges (owner, out ranges)) return new Collection<CustomAttribute> (); ``` The old behavior was probably the wrong. Although I'm not certain what the tangible impact was. The fix was pretty easy. `AssemblyReader.ReadCustomAttributes` will now pass in the custom attributes to `WindowsRuntimeProjections.Project` avoiding the need to call `type.CustomAttributes`
* Fix RVA field alignment * Use non-latest images to run tests * Revert windows-2019 change * Don't align code segment This wasn't aligned to begin with. Attempting to align it causes problems due to the way CodeWriter gets the code RVA - it computes the RVA from the CLI Header length, which doesn't take into account the code's alignment requirements. * Revert "Don't align code segment" This reverts commit 9410f1e. * Keep alignment values for code
With MSBuild 7.0.201 and later, building the Mono.Cecil projects used by Unity's IL2CPP causes warning NU1605 to occur, indicating that there is a package version mismatch between the .NET Framework reference assemblies package used. To avoid this, bump the version used by Mono.Cecil and similar project to be the latest, version 1.0.3. Note that MSBuild version 7.0.100 and earlier did not cause this warning to occur.
Co-authored-by: Marek Safar <[email protected]>
When resolving a `GenericInstanceMethod` for a `privatescope` method that has the same signature as other methods, `MetadataResolver.GetMethod` would incorrectly return the first method with the same name. The fix for this seems to be an optimization opportunity as well. Although I have to admit it feels a little to easy. Please make sure I'm not overlooking some reason why this fix is not safe. A added 2 variations of tests. `PrivateScope` - These tests were fine and passed as is. This is because the instruction operands are MethodDefinitions and therefore didn't need to be resolved by `MetadataResolver` `PrivateScopeGeneric` - This test triggered the bug.
* Add new flag for ByRefLike constraints * Allow seems to be the prefered nomenclature
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This brings in the latest cecil changes from upstream. Importantly, includes: