public inbox for smatch@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Toomas Soome <tsoome@me.com>
Cc: smatch@vger.kernel.org
Subject: Re: smatch, __builtin_unreachable() and uninitialized var...
Date: Tue, 18 Nov 2025 14:14:19 +0300	[thread overview]
Message-ID: <aRxVC3GZg3hZ5Zhg@stanley.mountain> (raw)
In-Reply-To: <A2726870-BF00-4BCE-A3CD-512B490AA644@me.com>

On Mon, Nov 17, 2025 at 11:50:42AM +0200, Toomas Soome wrote:
> hi!
> 
> While using smatch with OpenZFS code, we have stepped on this issue:
> 
> /home/runner/work/zfs/zfs/zfs/module/icp/algs/aes/aes_modes.c:90 aes_encrypt_contiguous_blocks() error: uninitialized symbol 'rv'.
> 
> 
> The function is using conditional call to function, which return value is stored to rv and the “impossible” else leg is marked with __builtin_unreachable() as seen there:
> 
> https://github.com/openzfs/zfs/blob/master/module/icp/algs/aes/aes_modes.c#L77
> 
> it would be nice if smatch could use __builtin_unreachable() there to avoid this error…
> 

Huh.  Surprising that I've never noticed that before.  I have fixed this
locally and will push the change after testing it tonight.  (I emailed the
Sparse developers to see if they want to change it in their code as well,
but either way I will update Smatch).

Thanks for the bug report.

regards,
dan carpenter

      reply	other threads:[~2025-11-18 11:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-17  9:50 smatch, __builtin_unreachable() and uninitialized var Toomas Soome
2025-11-18 11:14 ` Dan Carpenter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aRxVC3GZg3hZ5Zhg@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=smatch@vger.kernel.org \
    --cc=tsoome@me.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox