Skip to content

Commit e1516b4

Browse files
committed
Java: Describe StringLiteral.getValue() behavior for unpaired surrogates
1 parent bfb9577 commit e1516b4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

java/ql/lib/semmle/code/java/Expr.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,9 @@ class StringLiteral extends Literal, @stringliteral {
734734
/**
735735
* Gets the string represented by this string literal, that is, the content
736736
* of the literal without enclosing quotes and with escape sequences translated.
737+
*
738+
* Unpaired Unicode surrogate characters (U+D800 to U+DFFF) are replaced with the
739+
* replacement character U+FFFD.
737740
*/
738741
override string getValue() { result = super.getValue() }
739742

0 commit comments

Comments
 (0)