-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
Simple scenario:
- The game defines a type (U), which has been thoroughly virtualised by IPA as expected.
- I inherit the class (as C), override some method (M), and pass an instance of my class to a method within the game.
- 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels