diff options
Diffstat (limited to 'src/code_point.zig')
| -rw-r--r-- | src/code_point.zig | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/code_point.zig b/src/code_point.zig index 16648af..7a638af 100644 --- a/src/code_point.zig +++ b/src/code_point.zig | |||
| @@ -121,6 +121,9 @@ pub fn decodeAtCursor(bytes: []const u8, cursor: *uoffset) ?CodePoint { | |||
| 121 | } | 121 | } |
| 122 | if (st == RUNE_REJECT or cursor.* == bytes.len) { | 122 | if (st == RUNE_REJECT or cursor.* == bytes.len) { |
| 123 | @branchHint(.cold); | 123 | @branchHint(.cold); |
| 124 | // This, and the branch below, detect truncation, the | ||
| 125 | // only invalid state handled differently by the Maximal | ||
| 126 | // Subparts algorithm. | ||
| 124 | if (state_dfa[@intCast(u8dfa[byte])] == RUNE_REJECT) { | 127 | if (state_dfa[@intCast(u8dfa[byte])] == RUNE_REJECT) { |
| 125 | cursor.* -= 2; // +1 | 128 | cursor.* -= 2; // +1 |
| 126 | return .{ | 129 | return .{ |