Skip to content
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

Prevent double GetObjectData implementation for badly implemented serializable classes #554

Merged
merged 6 commits into from
Jan 20, 2021

Commits on Jan 20, 2021

  1. GetObjectData can cause verification failure

    An overridable `GetObjectData` method inside a `[Serializable]` class
    that does not implement `ISerializable` can be handled in two ways:
    
     1. It can be overridden as part of the `ISerializable` implementation
        that DynamicProxy provides for `[Serializable]` classes.
    
     2. It can be proxied regularly, like any other overridable method.
    
    Unfortunately, at this time, DynamicProxy does both, i.e. it produces
    two `GetObjectData` methods with identical signature in the same proxy
    type, which causes verification failure.
    
    The correct behavior is (1): The `ISerializable` implementation should
    take precedence over any method proxying, even though proxied methods
    are emitted first. (Thus the need for "the trick with methodsToSkip"!)
    stakx committed Jan 20, 2021
    Configuration menu
    Copy the full SHA
    c36db17 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8fa581f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    371f7b9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5775957 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d7b3930 View commit details
    Browse the repository at this point in the history
  6. Update changelog

    stakx committed Jan 20, 2021
    Configuration menu
    Copy the full SHA
    87b6e58 View commit details
    Browse the repository at this point in the history