Skip to content

Commit a1f82ec

Browse files
committed
[js] When rejecting an incomplete UTF-8 sequence try to see if the byte
that causes the rejection can be accepted on it's own
1 parent fe37f91 commit a1f82ec

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/vm/js/nqp-runtime/codecs.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,11 @@ class Utf8C8 {
196196

197197
if (state === UTF8_REJECT) {
198198
this.buildGraphemes(codePoints, chunks);
199-
this.reject(buf, accepted+1, i+1, chunks);
199+
this.reject(buf, accepted+1, accepted+2, chunks);
200200

201201
state = UTF8_ACCEPT;
202-
accepted = i;
202+
i = accepted+1;
203+
accepted = accepted+1;
203204
}
204205
}
205206

0 commit comments

Comments
 (0)