I followed the sample code in the \"3.2.6 Inline Method“ in the http://asm.ow2.org/current/asm-transformations.pdf, to inline a MethodNode to a call site.
My problem is
The problem is caused when the label (the classreader reads from a class file) is visited by a MethodVisitor
pipeline. The label has a field int [] srcAndRefPositions
. Two of its consecutive positions (cfr. the end of my original post) are updated once the label is accessed by a MethodVisitor. In my case, the label in the ifeq label
holds 2 MethodVisitors. It seems the incorrect position in the srcAndRefPositions
is used when generating the class file (using the last MethodVisitor).
I did not investigate the root cause. Instead, my solution was to clone the label and then use the new label when it is visited by a MethodVisitor.