Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misuse of debug names when debug names are disable #76

Open
phase opened this issue Jun 15, 2020 · 1 comment
Open

Misuse of debug names when debug names are disable #76

phase opened this issue Jun 15, 2020 · 1 comment

Comments

@phase
Copy link

phase commented Jun 15, 2020

When running ForgeFlower with -udv=0, debug names are showing up in the output. Here are the options I'm running with:

"-din=1", "-rbr=0", "-dgs=1", "-asc=1", "-hdc=0", "-rsy=1", "-iec=1", "-udv=0", "-jvn=1", "-log=WARN"

Here's a diff from vanilla FernFlower (build from a few days ago) and ForgeFlower 1.5.478.6 (06/13/20 10:44 PM):

@@ -96,17 +95,17 @@
    private final BiomeManager biomeManager;
    private final ResourceKey<Level> dimension;
    private final ResourceKey<DimensionType> dimensionTypeKey;
 
    protected Level(WritableLevelData var1, ResourceKey<Level> var2, ResourceKey<DimensionType> var3, DimensionType var4, Supplier<ProfilerFiller> var5, boolean var6, boolean var7, long var8) {
-      this.profiler = var5;
-      this.levelData = var1;
-      this.dimensionType = var4;
-      this.dimension = var2;
-      this.dimensionTypeKey = var3;
-      this.isClientSide = var6;
-      if (var4.shrunk()) {
+      this.profiler = ☃;
+      this.levelData = ☃;
+      this.dimensionType = ☃;
+      this.dimension = ☃;
+      this.dimensionTypeKey = ☃;
+      this.isClientSide = ☃;
+      if (☃.shrunk()) {
          this.worldBorder = new WorldBorder() {
             public double getCenterX() {
                return super.getCenterX() / 8.0D;
             }

full diff of Level
This happens in every class

@Alvinn8
Copy link

Alvinn8 commented Jun 28, 2021

I spent a good while trying to find the cause of this bug, and I finally found it. In patch 0010, there is a call to the getName method of the local variable which gets the name from the debug information without checking if the udv option is disabled, nor if it is even a valid identifier. I could PR a fix for this if you guys want, but I wasn't able to get the bytecode version in this context so I had to pass 0 to the last param of TextUtil.isValidIdentifier, not great, someone else can probably find a better solution there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants