Tweak json decode_trailer whitespace_length var
diff --git a/release/c/wuffs-unsupported-snapshot.c b/release/c/wuffs-unsupported-snapshot.c
index 91e3779..9263e47 100644
--- a/release/c/wuffs-unsupported-snapshot.c
+++ b/release/c/wuffs-unsupported-snapshot.c
@@ -34423,23 +34423,21 @@
if (((uint64_t)(io2_a_dst - iop_a_dst)) <= 0) {
status = wuffs_base__make_status(wuffs_base__suspension__short_write);
WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(1);
- v_whitespace_length = 0;
goto label__outer__continue;
}
+ v_whitespace_length = 0;
while (true) {
if (((uint64_t)(io2_a_src - iop_a_src)) <= 0) {
if (v_whitespace_length > 0) {
*iop_a_dst++ = wuffs_base__make_token(
(((uint64_t)(0)) << WUFFS_BASE__TOKEN__VALUE_MINOR__SHIFT) |
(((uint64_t)(v_whitespace_length)) << WUFFS_BASE__TOKEN__LENGTH__SHIFT));
- v_whitespace_length = 0;
}
if (a_src && a_src->meta.closed) {
goto label__outer__break;
}
status = wuffs_base__make_status(wuffs_base__suspension__short_read);
WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(2);
- v_whitespace_length = 0;
goto label__outer__continue;
}
v_c = wuffs_base__peek_u8be__no_bounds_check(iop_a_src);
@@ -34448,7 +34446,6 @@
*iop_a_dst++ = wuffs_base__make_token(
(((uint64_t)(0)) << WUFFS_BASE__TOKEN__VALUE_MINOR__SHIFT) |
(((uint64_t)(v_whitespace_length)) << WUFFS_BASE__TOKEN__LENGTH__SHIFT));
- v_whitespace_length = 0;
}
if (self->private_impl.f_trailer_stop > 0) {
status = wuffs_base__make_status(wuffs_json__error__bad_input);
@@ -34472,7 +34469,6 @@
goto suspend;
}
v_c = 0;
- v_whitespace_length = 0;
if (self->private_impl.f_comment_type > 0) {
goto label__outer__continue;
}
@@ -34484,7 +34480,6 @@
*iop_a_dst++ = wuffs_base__make_token(
(((uint64_t)(0)) << WUFFS_BASE__TOKEN__VALUE_MINOR__SHIFT) |
(((uint64_t)((v_whitespace_length + 1))) << WUFFS_BASE__TOKEN__LENGTH__SHIFT));
- v_whitespace_length = 0;
if (v_c == self->private_impl.f_trailer_stop) {
status = wuffs_base__make_status(NULL);
goto ok;
diff --git a/std/json/decode_json.wuffs b/std/json/decode_json.wuffs
index b884da0..78a8198 100644
--- a/std/json/decode_json.wuffs
+++ b/std/json/decode_json.wuffs
@@ -1688,10 +1688,10 @@
while.outer true {
if args.dst.length() <= 0 {
yield? base."$short write"
- whitespace_length = 0
continue.outer
}
+ whitespace_length = 0
while.inner true,
pre args.dst.length() > 0,
{
@@ -1699,13 +1699,11 @@
if whitespace_length > 0 {
args.dst.write_simple_token_fast!(
value_major: 0, value_minor: 0, continued: 0, length: whitespace_length)
- whitespace_length = 0
}
if args.src.is_closed() {
break.outer
}
yield? base."$short read"
- whitespace_length = 0
continue.outer
}
@@ -1714,14 +1712,12 @@
if whitespace_length > 0 {
args.dst.write_simple_token_fast!(
value_major: 0, value_minor: 0, continued: 0, length: whitespace_length)
- whitespace_length = 0
}
if this.trailer_stop > 0 {
return "#bad input"
}
this.decode_comment?(dst: args.dst, src: args.src)
c = 0
- whitespace_length = 0
if this.comment_type > 0 {
continue.outer
}
@@ -1732,7 +1728,6 @@
if (whitespace_length >= 0xFFFE) or (c == this.trailer_stop) {
args.dst.write_simple_token_fast!(
value_major: 0, value_minor: 0, continued: 0, length: whitespace_length + 1)
- whitespace_length = 0
if c == this.trailer_stop {
return ok
}