[llvm] [NFC]Add assert to avoid possibly deref nullptr (PR #65564)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 10 18:49:40 PDT 2023
XinWang10 wrote:
@JDevlieghere @adrian-prantl I know your principle is right. The reason I changed in this way is that this code has existed for several years, we haven't found any crash here so far, so I think add an assert would be a light weight fix to it. Using if-condition must be correct, but considering I have no evidence MMI would be nullptr from author's intention and if-condition could take more resource, I made this decision. I think we could let it here and if it do have risk it's not too late to change it back.
If you guys strongly object this patch, I would revert it and use if-condition instead.
https://github.com/llvm/llvm-project/pull/65564
More information about the llvm-commits
mailing list