Mixin icon indicating copy to clipboard operation
Mixin copied to clipboard

String index out of range during AP

Open shedaniel opened this issue 3 years ago • 0 comments

With the fix to #518 (https://github.com/SpongePowered/Mixin/commit/1e1aa7fb52dec78630f3f2f53fd70a4c496a7d66), Mixin tries to pretty print a field (asm field) with SignaturePrinter (works only with methods)

This doesn't crash in Mixin 0.8.4.

Type.getReturnType(desc) and Type.getArgumentTypes(desc): Expects a description with ): https://github.com/SpongePowered/Mixin/blob/155314e6e91465dad727e621a569906a410cd6f4/src/main/java/org/spongepowered/asm/util/SignaturePrinter.java#L86

TypeUtils uses it: https://github.com/SpongePowered/Mixin/blob/155314e6e91465dad727e621a569906a410cd6f4/src/ap/java/org/spongepowered/tools/obfuscation/mirror/TypeUtils.java#L277

TypeHandleASM uses it for anonymous classes for fields: https://github.com/SpongePowered/Mixin/blob/155314e6e91465dad727e621a569906a410cd6f4/src/ap/java/org/spongepowered/tools/obfuscation/mirror/TypeHandleASM.java#L224

Mixin: (0.8.5 on 1.18 ForgeGradle)

@Mixin(targets = "net.minecraft.server.level.ServerPlayer$2")
public class ServerPlayerEntityMixin {
    @Shadow
    ServerPlayer f_143458_;
}

idea64_enUUjZVbyA

shedaniel avatar Jan 31 '22 20:01 shedaniel