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

decompiling lambdas fails due to missing local variable declarations #10

Open
jurgenvinju opened this issue Oct 15, 2019 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@jurgenvinju
Copy link
Member

This is a disassembled lambda where you can see that there are no LOCALVARIABLE instructions for stack location 0 and 1. This stops their LOAD instructions from being decompiled and that blocks further decompilation steps downstream.

My guess is that the creating scope is captured by the 0 and 1 stack locations in lambda's, and so we need to add rules for recovering expressions for these LOADs somehow.

methodDesc(
      void(),
      "lambda$11",
      [
        object("java.lang.Object"),
        object("java.lang.Object"),
        object("io.usethesource.vallang.IConstructor"),
        object("java.lang.Integer")
      ]),
    [
      var(
        object("java.lang.Object"),
        "arg_0"),
      var(
        object("java.lang.Object"),
        "arg_0"),
      var(
        object("io.usethesource.vallang.IConstructor"),
        "arg_0"),
      var(
        object("java.lang.Integer"),
        "arg_0")
    ],
    [asm([
          LABEL("L20804602"),
          LINENUMBER(589,"L20804602"),
          ALOAD(0),
          ALOAD(3),
          INVOKEVIRTUAL(
            object("java.lang.Integer"),
            methodDesc(
              integer(),
              "intValue",
              []),
            false),
          ALOAD(1),
          INVOKESTATIC(
            object("java.lang.reflect.Array"),
            methodDesc(
              void(),
              "set",
              [
                object("java.lang.Object"),
                integer(),
                object("java.lang.Object")
              ]),
            false),
          RETURN(),
          LABEL("L1344519051"),
          LOCALVARIABLE(
            "S",
            object("io.usethesource.vallang.IConstructor"),
            "L20804602",
            "L1344519051",
            2),
          LOCALVARIABLE(
            "ind",
            object("java.lang.Integer"),
            "L20804602",
            "L1344519051",
            3)
        ])])
@jurgenvinju jurgenvinju added the enhancement New feature or request label Oct 15, 2019
jurgenvinju added a commit that referenced this issue Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant