-
I solved it, and this is information that is most likely too specific to be useful to anyone, but: in the example that was breaking I was emitting the bytecode into the static initializers of types rather than method bodies
-
Which isn't a problem in itself, but I wasn't "completing" the types when I was done. Normally you get an exception thrown when you forget to do that, but these types happen to be nested types, and for whatever reason I got silent failure instead
-
Without the completion step all kinds of things in the type do not get finalized, notably in this case branch targets do not get computed correctly and instead every branch will target the next instruction, which destroys your generated code
-
So, remember kids! Always complete your nested types when generating bytecode on the common language runtime ✌🏼✌🏼✌🏼
