Clear local variable table on RuntimeEnumExtender transformation (#8502)

This commit is contained in:
Gabriel Harris-Rouquette 2022-03-12 23:08:50 -08:00 committed by GitHub
parent df3c7ce19a
commit 72f5b3f84d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;