Closed toddATavail closed 7 years ago
You can do this instead name = string Utf8 "Todd L Smith"
So technically, there is no bug, it's just that the assembler format encourages you to shoot yourself in the foot here. I'm not sure whether it should be changed and how. Anyway, thanks for reporting this,
I changed it to avoid confusion. It's technically backwards incompatible, but I doubt anyone will care.
According to the JVM Specification 4.7.16.1, the constant type of a
String
annotation value isCONSTANT_Utf8
. When specifying aString
annotation value in a Krakatau assembly file, however, the generated constant isCONSTANT_String_info
.Consider this pared down version of
Q_First_Name.j
, one of the generated Krakatau files produced by my compiler:Here are the relevant excerpts from the generated class file, as reported by
javap -c -verbose
:The constant pool data should instead look like this:
ASM and the Oracle JVM both treat the generated class file as corrupt. In particular, I cannot
getAnnotations()
on the generated classes because of the following exception:My compiler went into production last month, and we are working toward the next version of the software. Our next milestone release is November 16. I'm not trying to pressure anyone into giving my issue priority, but I do need to assess whether I should sit tight and wait for a patch or dive into Krakatau and try to patch it myself.
Thanks!