invalidUtf8 -> invalidStringByte
This commit is contained in:
@@ -343,16 +343,12 @@ inline Status n_string2(Parser3 *self) {
|
||||
if (self->len() == 0) {
|
||||
return S_REJECT;
|
||||
}
|
||||
// Try subtract and unsigned compare to save a branch?
|
||||
if (uint8_t(*self->buf) < 0x20) {
|
||||
if (tables.invalidStringByte[uint8_t(*self->buf)]) {
|
||||
return S_REJECT;
|
||||
}
|
||||
if (*self->buf != '"') {
|
||||
self->callbacks->on_string_data(self->data, self->buf, 1);
|
||||
}
|
||||
if (tables.invalidUtf8[uint8_t(*self->buf)]) {
|
||||
return S_REJECT;
|
||||
}
|
||||
if (int8_t(*self->buf) > 0) {
|
||||
// one byte utf-8 encoding
|
||||
switch (*self->buf) {
|
||||
@@ -445,7 +441,7 @@ inline Status t_utf8_continuation_byte(Parser3 *self) {
|
||||
if (self->len() == 0) {
|
||||
return S_REJECT;
|
||||
}
|
||||
if (tables.invalidUtf8[uint8_t(*self->buf)]) {
|
||||
if (tables.invalidStringByte[uint8_t(*self->buf)]) {
|
||||
return S_REJECT;
|
||||
}
|
||||
if ((*self->buf & 0b11000000) == 0b10000000) {
|
||||
@@ -463,7 +459,7 @@ inline Status t_utf8_last_continuation_byte(Parser3 *self) {
|
||||
if (self->len() == 0) {
|
||||
return S_REJECT;
|
||||
}
|
||||
if (tables.invalidUtf8[uint8_t(*self->buf)]) {
|
||||
if (tables.invalidStringByte[uint8_t(*self->buf)]) {
|
||||
return S_REJECT;
|
||||
}
|
||||
if ((*self->buf & 0b11000000) == 0b10000000) {
|
||||
|
||||
Reference in New Issue
Block a user