Description
In an effort to support Kotlin Coroutines instrumentation, modify the weaver to support the edge case presented by Kotlin bytecode for invokeSuspend
.
The issue was investigated as a spike in #2002 , where errors were thrown during weaving of invokeSuspend
. The investigation found that the Kotlin compiler intentionally duplicates operands on the stack prior to return instructions in the body of invokeSuspend
. Though innocuous for return
instructions, these extra operands cause bytecode verification to fail when return
is replaced with goto
(which is how the agent performs its bytecode modification).
We should update the weaver to handle this edge case, so that weaving for invokeSuspend
succeeds. This fix should be wrapped in a feature flag/some kind of blocker to prevent the fix from applying to any other methods at this time.
Metadata
Assignees
Type
Projects
Status
In Progress