[clang] [analyzer] Fix crash in Stream checker when using void pointers (PR #97199)
Balazs Benics via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 1 06:46:48 PDT 2024
steakhal wrote:
> Overall, I'd say that it's futile to try to recognize zero-sized types with a "canonical type equal to" check, so you should just check whether `ElemSizeInChars` is zero and do something based on that. (Either an early return, or you can say `ElemSizeInChars = 1` at that point if you think that that's the logically correct solution.)
Yes :/
> `<bikeshedding>`This way you could also avoid the immediately invoked lambda in `getPointeeType` which is really ugly in my opinion.`</bikeshedding>`
Alright. Duplicated the call I wanted to avoid, but I agree it looks better now.
> _I only noticed that this PR was already merged after posting the review. There is no need to revert the commit -- it's better than nothing -- but I'd be happy if you created a followup change that also handles the testcase that I mentioned._
I'm not sure what you refer to. This PR is not approved, hence not merged.
Please continue with the review.
https://github.com/llvm/llvm-project/pull/97199
More information about the cfe-commits
mailing list