SpongePowered / Mixin

Mixin is a trait/mixin and bytecode weaving framework for Java using ASM
MIT License
1.4k stars 192 forks source link

String index out of range during AP #560

Closed shedaniel closed 8 months ago

shedaniel commented 2 years ago

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

RubixDev commented 6 months ago

I'm encountering this issue with Forge using Architectury. Is there maybe a way I could set it to use version 0.8.4 or the Fabric fork for now?