Uploaded image for project: 'Quarkus'
  1. Quarkus
  2. QUARKUS-3164

Logging with Panache: fix LocalVariablesSorter usage

XMLWordPrintable

      The `LocalVariablesSorter` utility from ASM is prone to misuse [1], which is exactly what happened in the Logging with Panache bytecode transformation. As a result, the transformed bytecode didn't obey the JVM stack discipline, leading to verification errors or possibly incorrect log messages.

      With this commit, instructions that refer to the newly allocated local variables are emitted directly through the original `MethodVisitor`, bypassing the `LocalVariablesSorter`. Therefore, local variable slot numbers in these instructions are not transformed and will not refer to wrong local variables.

      [1] https://stackoverflow.com/questions/50140365/asm-strange-localvar-index-using-newlocal-from-localvariablesorter

      Fixes #32663

              Unassigned Unassigned
              probinso_jira Quarkus JIRA Bot
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: