For loop with nested try-with

Open
#31 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
java
Domain
compilers

Research direction

Use the reported TextureGlyphProviderUnicode constructor as the reproduction case and inspect ForgeFlower's handling of a for loop containing nested try-with-resources. Confirm the expected decompiled loop structure and add a regression check showing that the construct is emitted consistently without the reported inconsistency.

Written by the indexing model from the issue text.

Description

1.13.1 TextureGlyphProviderUnicode constructor

      this.field_211257_b = p_i49737_1_;
      this.field_211258_c = p_i49737_2_;
      this.field_211259_d = p_i49737_3_;

      label322:
      for(int i = 0; i < 256; ++i) {
         char c0 = (char)(i * 256);
         ResourceLocation resourcelocation = this.func_211623_c(c0);

         try (
            IResource iresource = this.field_211257_b.func_199002_a(resourcelocation);
            NativeImage nativeimage = NativeImage.func_211679_a(NativeImage.PixelFormat.RGBA, iresource.func_199027_b());
         ) {
            if (nativeimage.func_195702_a() == 256 && nativeimage.func_195714_b() == 256) {
               int j = 0;

               while(true) {
                  if (j >= 256) {
                     continue label322;
                  }

                  byte b0 = p_i49737_2_[c0 + j];
                  if (b0 != 0 && func_212453_a(b0) > func_212454_b(b0)) {
                     p_i49737_2_[c0 + j] = 0;
                  }

                  ++j;
               }
            }
         } catch (IOException var43) {
            ;
         }

         Arrays.fill(p_i49737_2_, c0, c0 + 256, (byte)0);
      }

   }
Dominant language
No language data
Stars
110
Forks
49
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MinecraftForge/ForgeFlower

All issues in MinecraftForge/ForgeFlower

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.