Clear local variable table on RuntimeEnumExtender transformation (#8340)

Signed-off-by: Gabriel Harris-Rouquette <[email protected]>
This commit is contained in:
Gabriel Harris-Rouquette authored and GitHub committed 2022-03-13 21:51:40 +01:00
1 parent e81a984165
commit 3b54aea224
1 file changed
+14 -1
@@ -1,6 +1,6 @@
/*
* Minecraft Forge
* Copyright (c) 2016-2021.
* Copyright (c) 2016-2022.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -150,6 +150,19 @@ public class RuntimeEnumExtender implements ILaunchPluginService {
mtd.access |= Opcodes.ACC_SYNCHRONIZED;
mtd.instructions.clear();
mtd.localVariables.clear();
if (mtd.tryCatchBlocks != null)
{
mtd.tryCatchBlocks.clear();
}
if (mtd.visibleLocalVariableAnnotations != null)
{
mtd.visibleLocalVariableAnnotations.clear();
}
if (mtd.invisibleLocalVariableAnnotations != null)
{
mtd.invisibleLocalVariableAnnotations.clear();
}
InstructionAdapter ins = new InstructionAdapter(mtd);
int vars = 0;