jgpc42 / insn

Functional JVM bytecode generation for Clojure.
Eclipse Public License 1.0
198 stars 5 forks source link

Fix invokeinterface when no iface argument is provided. #13

Closed phronmophobic closed 2 years ago

phronmophobic commented 2 years ago

For version 0.5.3, https://github.com/jgpc42/insn/commit/d95a5837c474476e908c39222dd8ef6dcb200093 exposed the interface arg to method instructions. When no interface arg is provided, the interface arg always defaults to false. If you look at the implementation for visitMethodInsn, the default should be false except for the invoke interface opcode. Passing false when the opcode is invoke interface can lead to invalid constant pool exception as seen in this issue, https://github.com/jgpc42/insn/issues/12.

jgpc42 commented 2 years ago

@borkdude @phronmophobic

Thanks for fixing this oversight. I'll have this merged and a new release shortly.