From eb1cf426c28d6e79b4adbc0b5193bd6eb82051db Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 24 Oct 2024 19:10:14 +0900 Subject: [PATCH] Tell gcc-14 that `Qnil` is not passed to `gzfile_calc_crc` Suppress false positive warnings due to a bug in gcc-14 optimizer. --- ext/zlib/zlib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 0899861..e9535aa 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -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; @@ -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");