File tree 1 file changed +5
-3
lines changed
src/org/sosy_lab/java_smt/solvers/z3
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -923,9 +923,11 @@ public Object convertValue(Long value) {
923
923
return ratValue .isIntegral () ? ratValue .getNum () : ratValue ;
924
924
} else if (type .isStringType ()) {
925
925
String str = Native .getString (environment , value );
926
- return isUnicodeEnabled ()
927
- ? AbstractStringFormulaManager .unescapeUnicodeForSmtlib (str )
928
- : str ;
926
+ // Calling `unescape` followed by ` escape` has the effect of escaping all backslashes
927
+ // that are not part of a valid escape sequence
928
+ String unicode = AbstractStringFormulaManager .unescapeUnicodeForSmtlib (str );
929
+ String escaped = AbstractStringFormulaManager .escapeUnicodeForSmtlib (unicode );
930
+ return isUnicodeEnabled () ? unicode : escaped ;
929
931
} else if (type .isBitvectorType ()) {
930
932
return new BigInteger (Native .getNumeralString (environment , value ));
931
933
} else if (type .isFloatingPointType ()) {
You can’t perform that action at this time.
0 commit comments