Skip to content

Commit 0228033

Browse files
authored
Ignore ASM labels for figuring out transport version constant strings
This fixes a bug related to transport version constant strings where we can get a label instruction instead of an ldc instruction during collection of transport references.
1 parent 4b502f5 commit 0228033

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/CollectTransportVersionReferencesTask.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ public void visitLineNumber(int line, Label start) {
101101
lineNumber = line;
102102
}
103103

104+
@Override
105+
public void visitLabel(Label label) {
106+
// asm uses many debug labels that we do not want to consider
107+
// so we ignore labels so they do not become part of the instructions list
108+
}
109+
104110
@Override
105111
public void visitMethodInsn(int opcode, String owner, String name, String descriptor, boolean isInterface) {
106112
if (owner.equals(TRANSPORT_VERSION_SET_CLASS) && name.equals(TRANSPORT_VERSION_SET_METHOD_NAME)) {

0 commit comments

Comments
 (0)