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

Upgrading to 0.5.3 causes Constant pool index 75 is invalid #12

Closed
borkdude opened this issue Apr 13, 2022 · 3 comments
Closed

Upgrading to 0.5.3 causes Constant pool index 75 is invalid #12

borkdude opened this issue Apr 13, 2022 · 3 comments
Labels

Comments

@borkdude
Copy link

borkdude commented Apr 13, 2022

Hi @jgpc42 - I upgraded to 0.5.3 for the new support for the invokespecial of a default interface method. But doing so broke generation of the classes that worked using 0.5.2. When constructing such a class, I'm getting errors like:

Syntax error (VerifyError) compiling new at (build/reify2.clj:171:1).
Illegal type at constant pool entry 75 in class babashka.impl.clojure.lang.IFn
Exception Details:
  Location:
    babashka/impl/clojure/lang/IFn.invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; @7: invokeinterface
  Reason:
    Constant pool index 75 is invalid
  Bytecode:
    0000000: 2ab4 0036 b200 24b9 004b 0200 c000 063a
    0000010: 0b19 0bc6 001d 190b 2a2b 2c2d 1904 1905
    0000020: 1906 1907 1908 1909 190a b900 5f0c 00b0
    0000030: 2a2b 2c2d 1904 1905 1906 1907 1908 1909
    0000040: 190a b700 87b0                         
  Stackmap Table:
    append_frame(@48,Object[#6])

I tried downgrading ASM to 9.0 but that wasn't the issue.

The code to repro:

https://github.com/babashka/babashka/blob/72efde064e4e62ae847999479df31f35092c9588/reify/build/reify2.clj

@borkdude
Copy link
Author

Here is the sample class:

IFn.class.zip

javap -v IFn.class is showing that there is a InterfaceMethodref in the constant pool:

#75 = InterfaceMethodref #71.#74       // java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;

@borkdude
Copy link
Author

Actually that was the same with 0.5.2 and even the javap output seems to be the same.

@jgpc42
Copy link
Owner

jgpc42 commented Apr 14, 2022

I just released 0.5.4. Thank you for opening this and thank you @phronmophobic for the fix.

@jgpc42 jgpc42 closed this as completed Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants