Have "return ok" set coro_susp_point = 0.

This commit is contained in:
Nigel Tao committed 2017-10-07 14:43:25 +11:00
1 parent 585ea2024d
commit a12292d094
6 files changed
+60 -15

No files matched your search

+24 -1
View File
@@ -302,8 +302,10 @@ puffs_flate_status puffs_flate_zlib_decoder_decode(
case n:;
#define PUFFS_COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(n) \
if (status <= 0) { \
if (status < 0) { \
goto exit; \
} else if (status == 0) { \
goto ok; \
} \
coro_susp_point = n; \
goto suspend; \
@@ -779,6 +781,9 @@ puffs_flate_status puffs_flate_decoder_decode(puffs_flate_decoder* self,
status = v_z;
PUFFS_COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(3);
}
goto ok;
ok:
self->private_impl.c_decode[0].coro_susp_point = 0;
goto exit;
}
@@ -950,6 +955,9 @@ puffs_flate_status puffs_flate_decoder_decode_blocks(puffs_flate_decoder* self,
goto suspend;
}
}
goto ok;
ok:
self->private_impl.c_decode_blocks[0].coro_susp_point = 0;
goto exit;
}
@@ -1091,6 +1099,9 @@ puffs_flate_status puffs_flate_decoder_decode_uncompressed(
PUFFS_COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(3);
}
label_0_break:;
goto ok;
ok:
self->private_impl.c_decode_uncompressed[0].coro_susp_point = 0;
goto exit;
}
@@ -1405,6 +1416,9 @@ puffs_flate_status puffs_flate_decoder_decode_huffman(
label_0_break:;
self->private_impl.f_bits = v_bits;
self->private_impl.f_n_bits = v_n_bits;
goto ok;
ok:
self->private_impl.c_decode_huffman[0].coro_susp_point = 0;
goto exit;
}
@@ -1510,6 +1524,9 @@ puffs_flate_status puffs_flate_decoder_init_fixed_huffman(
if (status) {
goto suspend;
}
goto ok;
ok:
self->private_impl.c_init_fixed_huffman[0].coro_susp_point = 0;
goto exit;
}
@@ -1730,6 +1747,9 @@ puffs_flate_status puffs_flate_decoder_init_dynamic_huffman(
}
self->private_impl.f_bits = v_bits;
self->private_impl.f_n_bits = v_n_bits;
goto ok;
ok:
self->private_impl.c_init_dynamic_huffman[0].coro_susp_point = 0;
goto exit;
}
@@ -2196,6 +2216,9 @@ puffs_flate_status puffs_flate_zlib_decoder_decode(
}
}
v_checksum = t_3;
goto ok;
ok:
self->private_impl.c_decode[0].coro_susp_point = 0;
goto exit;
}
+23 -3
View File
@@ -271,8 +271,10 @@ puffs_gif_status puffs_gif_lzw_decoder_decode(puffs_gif_lzw_decoder* self,
case n:;
#define PUFFS_COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(n) \
if (status <= 0) { \
if (status < 0) { \
goto exit; \
} else if (status == 0) { \
goto ok; \
} \
coro_susp_point = n; \
goto suspend; \
@@ -724,12 +726,15 @@ puffs_gif_status puffs_gif_decoder_decode(puffs_gif_decoder* self,
}
} else if (v_c == 59) {
status = PUFFS_GIF_STATUS_OK;
goto suspend;
goto ok;
} else {
status = PUFFS_GIF_ERROR_BAD_GIF_BLOCK;
goto exit;
}
}
goto ok;
ok:
self->private_impl.c_decode[0].coro_susp_point = 0;
goto exit;
}
@@ -816,6 +821,9 @@ puffs_gif_status puffs_gif_decoder_decode_header(puffs_gif_decoder* self,
status = PUFFS_GIF_ERROR_BAD_GIF_HEADER;
goto exit;
}
goto ok;
ok:
self->private_impl.c_decode_header[0].coro_susp_point = 0;
goto exit;
}
@@ -928,6 +936,9 @@ puffs_gif_status puffs_gif_decoder_decode_lsd(puffs_gif_decoder* self,
v_i += 1;
}
}
goto ok;
ok:
self->private_impl.c_decode_lsd[0].coro_susp_point = 0;
goto exit;
}
@@ -1045,6 +1056,9 @@ puffs_gif_status puffs_gif_decoder_decode_extension(puffs_gif_decoder* self,
b_rptr_src += self->private_impl.c_decode_extension[0].scratch;
}
label_0_break:;
goto ok;
ok:
self->private_impl.c_decode_extension[0].coro_susp_point = 0;
goto exit;
}
@@ -1200,6 +1214,9 @@ puffs_gif_status puffs_gif_decoder_decode_id(puffs_gif_decoder* self,
}
}
label_0_break:;
goto ok;
ok:
self->private_impl.c_decode_id[0].coro_susp_point = 0;
goto exit;
}
@@ -1374,7 +1391,7 @@ puffs_gif_status puffs_gif_lzw_decoder_decode(puffs_gif_lzw_decoder* self,
goto label_0_continue;
} else if (v_code == v_end_code) {
status = PUFFS_GIF_STATUS_OK;
goto suspend;
goto ok;
} else if (v_code <= v_save_code) {
v_s = 4095;
v_c = v_code;
@@ -1425,6 +1442,9 @@ puffs_gif_status puffs_gif_lzw_decoder_decode(puffs_gif_lzw_decoder* self,
}
v_prev_code = v_code;
}
goto ok;
ok:
self->private_impl.c_decode[0].coro_susp_point = 0;
goto exit;
}