File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed
Sources/TOMLDecoder/Parsing Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -1100,7 +1100,6 @@ extension Token {
11001100 var index = text. lowerBound
11011101 var endIndex = text. upperBound
11021102
1103- assert ( quoteChar == CodeUnits . doubleQuote || quoteChar == CodeUnits . singleQuote)
11041103
11051104 if endIndex - index >= 3 && bytes [ index] == CodeUnits . doubleQuote && bytes [ index + 1 ] == CodeUnits . doubleQuote && bytes [ index + 2 ] == CodeUnits . doubleQuote ||
11061105 endIndex - index >= 3 && bytes [ index] == CodeUnits . singleQuote && bytes [ index + 1 ] == CodeUnits . singleQuote && bytes [ index + 2 ] == CodeUnits . singleQuote
@@ -1117,7 +1116,7 @@ extension Token {
11171116 } else {
11181117 index = index + 1
11191118 endIndex = endIndex - 1
1120- guard bytes [ endIndex] == quoteChar else {
1119+ guard endIndex >= 0 , bytes [ endIndex] == quoteChar else {
11211120 throw TOMLError ( . invalidString( context: context, lineNumber: lineNumber, reason: " missing closing quote " ) )
11221121 }
11231122 }
You can’t perform that action at this time.
0 commit comments