Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9e0a5bc

Browse files
committedFeb 22, 2025
Strings: Add a separate case for the escape sequence "\u{5c}" in unescapeUnicodeForSmtlib() as backslashes (= codepoint 5c) are considered special characters by Matcher.appendReplacement()
1 parent c57c69a commit 9e0a5bc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎src/org/sosy_lab/java_smt/basicimpl/AbstractStringFormulaManager.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,13 @@ public static String unescapeUnicodeForSmtlib(String input) {
104104
checkArgument(
105105
isCodePointInRange(codePoint),
106106
"SMTLIB does only specify Unicode letters from Planes 0-2");
107-
matcher.appendReplacement(sb, Character.toString(codePoint));
107+
String replacement = Character.toString(codePoint);
108+
if (replacement.equals("\\")) {
109+
// Matcher.appendReplacement considers '\' as special character.
110+
// Substitute with '\\' instead
111+
replacement = "\\\\";
112+
}
113+
matcher.appendReplacement(sb, replacement);
108114
}
109115
matcher.appendTail(sb);
110116
return sb.toString();

0 commit comments

Comments
 (0)
Please sign in to comment.