Subject: Re: [Bug] hook: -Wanalyzer-deref-before-check warning in run_hooks_opt

From: Patrick Steinhardt <[email-masked]>
Date: Fri, 9 Jan 2026 17:18:54 +0100

On Fri, Jan 09, 2026 at 11:02:40AM -0500, Ben Knoble wrote:
> 
> > Le 9 janv. 2026 à 06:31, Patrick Steinhardt <[email-masked]> a écrit :
> 
> [snip]
> 
> > And we'd reliably
> > segfault anyway if we dereference the pointer, even though we would not
> > get a clean error message. Not sure whether that really is worth the
> > hassle though.
> 
> I think you’re probably right in practice, but doesn’t the standard just say dereferencing a NULL pointer is undefined behavior? Just wondering for my own curiosity :)

It is, yeah. But I'd claim that on almost all platforms out there it
would segfault anyway.

Patrick