[clang-tools-extra] [clang][dataflow]Use cast_or_null instead of cast to prevent crash (PR #68510)

Qizhi Hu via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 18 19:38:34 PDT 2023


jcsxky wrote:

> Thanks, looks good!
> 
> You can submit as is, but if you're up for it, it would actually be better to add the new test case directly to the model's unittests. Something like this test (though just one case is enough -- please put it in a separate TEST_P):
> 
> https://github.com/llvm/llvm-project/blob/a3a0f59a1e1cb0ac02f06b19f730ea05a6541c96/clang/unittests/Analysis/FlowSensitive/UncheckedOptionalAccessModelTest.cpp#L1966
> 
> In general, the lit tests for the clang tidy check only do minimal testing to ensure the check is properly calling the model.

Thanks for your suggestion! New test case has been added to unittests.

https://github.com/llvm/llvm-project/pull/68510


More information about the cfe-commits mailing list