Skip to content

Commit 5ffd9c2

Browse files
gfourmbenz89
authored andcommitted
Make the fresh-local-variable separator configurable.
1 parent bd4d32a commit 5ffd9c2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/java/soot/shimple/internal/ShimpleBodyBuilder.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ protected Local fetchNewLocal(Local local, Integer subscript) {
396396

397397
// If the name already exists, makeUniqueLocalNames() will
398398
// take care of it.
399-
String name = oldLocal.getName() + "_" + subscript;
399+
String name = oldLocal.getName() + freshSeparator + subscript;
400400

401401
Local newLocal = newLocals.get(name);
402402

@@ -463,9 +463,14 @@ public String makeUniqueLocalName(String dupName, Set<String> localNames) {
463463
String newName = dupName;
464464

465465
while (localNames.contains(newName)) {
466-
newName = dupName + "_" + counter++;
466+
newName = dupName + freshSeparator + counter++;
467467
}
468468

469469
return newName;
470470
}
471+
472+
static String freshSeparator = "_";
473+
public static void setSeparator(String sep) {
474+
freshSeparator = sep;
475+
}
471476
}

0 commit comments

Comments
 (0)