Skip to content

Virtualisation does not work on method calls #12

@Quit

Description

@Quit

Simple scenario:

  1. The game defines a type (U), which has been thoroughly virtualised by IPA as expected.
  2. I inherit the class (as C), override some method (M), and pass an instance of my class to a method within the game.
  3. Said method is calling the (now virtualised) method M. I expect my method (C.M) be called; but it is calling the original one (U.M).

The reason is that the IL for virtual method calls and normal calls is different. For normal method calls, no lookup is performed, and it will always go straight for the original implementation. This kinda nullifies the virtualisation of methods, because overriding them doesn't really do anything.

The behaviour is similar as if the class wasn't virtual, and I were to override the method using new. A possible "fix" would be to change the IL to adjust all method calls to virtual calls; however doing so likely incurs a performance impact, if it is even possible at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions