[PATCH] D123961: [clang][dataflow] Do not crash on missing `Value` for struct-typed variable init.

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 19 09:02:55 PDT 2022

xazax.hun accepted this revision.
xazax.hun added inline comments.
This revision is now accepted and ready to land.

Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:184-186
-      // FIXME: The initializer expression must always be assigned a value.
-      // Replace this with an assert when we have sufficient coverage of
-      // language features.
ymandel wrote:
> sgatev wrote:
> > The patch makes sense to me in the current state, but it's unclear why is this not something that we'd like to do in the long term.
> Because of uninterpreted fields. If we consider those a temporary fix, then I agree about the long term. I'd thought those were here to stay.  That said, if we find a way to either interperet fields lazily or only interpret those needed in the current function scope, we may be able to avoid uninterpreted expressions.
> This also begs the question as to why we insist on initializing the variable. Arguably, if the expresssion is uninterpreted, so should be the variable. So, we should at least explain why we're distinguishing. Thoughts on my adding a comment to that effect?
>Because of uninterpreted fields.

Could you elaborate on this? Do you mean fields being uninterpreted due to hitting a depth limit or being recursive? Or is this something else?

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list