ra’s avatarra’s Twitter Archive—№ 38,345

          1. past me: i want to work on compilers present me: identical code paths are generating subtly different branch targets (?!) but otherwise identical bytecode depending on what optimizations are turned on, ok
            oh my god twitter doesn’t include alt text from images in their API
        1. …in reply to @ra
          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
      1. …in reply to @ra
        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
    1. …in reply to @ra
      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
  1. …in reply to @ra
    So, remember kids! Always complete your nested types when generating bytecode on the common language runtime ✌🏼✌🏼✌🏼