Skip to content

Commit

Permalink
Tell gcc-14 that Qnil is not passed to gzfile_calc_crc
Browse files Browse the repository at this point in the history
Suppress false positive warnings due to a bug in gcc-14 optimizer.
  • Loading branch information
nobu committed Oct 24, 2024
1 parent 3b45a5b commit eb1cf42
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ext/zlib/zlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -4229,6 +4229,7 @@ gzreader_skip_linebreaks(struct gzfile *gz)
while (n++, *(p++) == '\n') {
if (n >= ZSTREAM_BUF_FILLED(&gz->z)) {
str = zstream_detach_buffer(&gz->z);
ASSUME(!NIL_P(str));
gzfile_calc_crc(gz, str);
while (ZSTREAM_BUF_FILLED(&gz->z) == 0) {
if (GZFILE_IS_FINISHED(gz)) return;
Expand Down Expand Up @@ -4637,6 +4638,7 @@ zlib_gunzip_run(VALUE arg)

gzfile_read_header(gz, Qnil);
dst = zstream_detach_buffer(&gz->z);
ASSUME(!NIL_P(dst));
gzfile_calc_crc(gz, dst);
if (!ZSTREAM_IS_FINISHED(&gz->z)) {
rb_raise(cGzError, "unexpected end of file");
Expand Down

0 comments on commit eb1cf42

Please sign in to comment.