Skip to content

Commit

Permalink
Fix an issue with a Stack Overflow if a method has a lambda that refe…
Browse files Browse the repository at this point in the history
…rences itself as a lambda
  • Loading branch information
OroArmor committed Feb 8, 2023
1 parent 1ce4aef commit ee95c91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ allprojects {
group = 'org.quiltmc.unpick'

def ENV = System.getenv()
version = "3.0.5" + (ENV.SNAPSHOTS_URL ? "-SNAPSHOT" : "")
version = "3.0.6" + (ENV.SNAPSHOTS_URL ? "-SNAPSHOT" : "")
version = version + (ENV.GITHUB_ACTIONS ? "" : "+local")

sourceCompatibility = 1.8
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/daomephsta/unpick/api/ConstantUninliner.java
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,12 @@ private Consumer<Context> processUsage(String methodOwner, MethodNode enclosingM
String samOwner = Type.getMethodType(invokeDynamic.desc).getReturnType().getInternalName();
String samName = invokeDynamic.name;
String samDesc = ((Type) invokeDynamic.bsmArgs[0]).getDescriptor();
lambdaSAMs.put(MethodTriple.fromHandle(implementation), new MethodTriple(samOwner, samName, samDesc));
MethodTriple old = lambdaSAMs.put(MethodTriple.fromHandle(implementation), new MethodTriple(samOwner, samName, samDesc));

if (old != null) {
return null;
}

if (lambdaOwner.name.equals(methodOwner) && lambda.name.equals(enclosingMethod.name)) {
return null;
}
Expand Down

0 comments on commit ee95c91

Please sign in to comment.