From 72f5b3f84ddb268ad03e9bde97dc4a7da2a2fe10 Mon Sep 17 00:00:00 2001 From: Gabriel Harris-Rouquette Date: Sat, 12 Mar 2022 23:08:50 -0800 Subject: [PATCH] Clear local variable table on RuntimeEnumExtender transformation (#8502) --- .../fml/common/asm/RuntimeEnumExtender.java | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/fmlloader/src/main/java/net/minecraftforge/fml/common/asm/RuntimeEnumExtender.java b/fmlloader/src/main/java/net/minecraftforge/fml/common/asm/RuntimeEnumExtender.java index 5d80dd796a..488f1335d2 100644 --- a/fmlloader/src/main/java/net/minecraftforge/fml/common/asm/RuntimeEnumExtender.java +++ b/fmlloader/src/main/java/net/minecraftforge/fml/common/asm/RuntimeEnumExtender.java @@ -1,20 +1,6 @@ /* - * Minecraft Forge - * Copyright (c) 2016-2021. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Minecraft Forge - Forge Development LLC + * SPDX-License-Identifier: LGPL-2.1-only */ package net.minecraftforge.fml.common.asm; @@ -149,6 +135,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;