-
Notifications
You must be signed in to change notification settings - Fork 50
Description
The Proguard settings used for these versions include a local variable optimization that drops locals to lower indices in the stack frame. It even re-uses indices normally reserved for the method parameters. As a result, (some) parameters are no longer accessible from everywhere in the method.
As an example, in Minecraft Infdev 0.31.20100629 there's a method MobEntity.die(Entity)void (Feather mappings). At the start of the method, there are just two locals in the stack frame:
- 0:
MobEntity(thethisvariable) - 1:
Entity(the method parameter)
Early on in the method, a new int variable is created, after which the following locals are in the stack frame:
- 0:
MobEntity(thethisvariable) - 1:
int(the new variable)
The method parameter has completely disappeared, and is no longer accessible from this point on. This causes crashes when injectors target any instruction after this point, and try to access the method parameter. Mixin assumes the parameter is available at index 1, and attempts to pass the int variable where an Entity variable is expected, leading to a VerifyError.
I am not sure if it is within scope for Mixin to fix this, but I thought it would be good to have it documented regardless.