[PATCH] D85193: [clang] Do not use an invalid expression to update the initializer.

Aleksandr Platonov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 11 02:00:19 PDT 2020


ArcsinX added a comment.

In D85193#2207798 <https://reviews.llvm.org/D85193#2207798>, @aaron.ballman wrote:

> In D85193#2207052 <https://reviews.llvm.org/D85193#2207052>, @ArcsinX wrote:
>
>> In D85193#2204685 <https://reviews.llvm.org/D85193#2204685>, @aaron.ballman wrote:
>>
>>> I sort of wonder if the correct change is to make `UpdateStructuredListElement()` resilient to being passed a null `Expr *` and then removing the manual increments when the expression is an error.
>>
>> Should it be in this patch?
>
> Given that we have at least four uses of this pattern in the file, I'd say it should be this patch. WDYT?

Agree, updated patch.

But I am not sure about correct place for `expr` check. Seems `nullptr` dereference possible only here: `diagnoseInitOverride(PrevInit, expr->getSourceRange());`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85193/new/

https://reviews.llvm.org/D85193



More information about the cfe-commits mailing list