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

2020-08-12 Thread Aleksandr Platonov via Phabricator via cfe-commits
ArcsinX updated this revision to Diff 284987. ArcsinX added a comment. Update comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85193/new/ https://reviews.llvm.org/D85193 Files: clang/lib/Sema/SemaInit.cpp clang/test/Sema/init-invalid-stru

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

2020-08-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Comment at: clang/lib/Sema/SemaInit.cpp:3088 // No structured initializer list to update if (!StructuredList) return; ArcsinX

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

2020-08-11 Thread Aleksandr Platonov via Phabricator via cfe-commits
ArcsinX added inline comments. Comment at: clang/lib/Sema/SemaInit.cpp:3088 // No structured initializer list to update if (!StructuredList) return; aaron.ballman wrote: > I would move the check up to here as the only time we should get a null > expre

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

2020-08-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaInit.cpp:3088 // No structured initializer list to update if (!StructuredList) return; I would move the check up to here as the only time we should get a null expression is if somethi

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

2020-08-11 Thread Aleksandr Platonov via Phabricator via cfe-commits
ArcsinX added a comment. In D85193#2207798 , @aaron.ballman wrote: > In D85193#2207052 , @ArcsinX wrote: > >> In D85193#2204685 , @aaron.ballman >> wrote: >> >>> I sort of

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

2020-08-11 Thread Aleksandr Platonov via Phabricator via cfe-commits
ArcsinX updated this revision to Diff 284612. ArcsinX added a comment. Check for `expr == nullptr` inside `InitListChecker::UpdateStructuredListElement()` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85193/new/ https://reviews.llvm.org/D85193 Fi

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

2020-08-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D85193#2207052 , @ArcsinX wrote: > In D85193#2204685 , @aaron.ballman > wrote: > >> Should the `StructuredIndex` still be incremented even in the case of an >> error, as done arou

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

2020-08-10 Thread Aleksandr Platonov via Phabricator via cfe-commits
ArcsinX added a comment. In D85193#2204685 , @aaron.ballman wrote: > Should the `StructuredIndex` still be incremented even in the case of an > error, as done around line 1589 and 1647? Yes, it looks like we need to increment `StructuredIndex`. > Do we

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

2020-08-08 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Should the `StructuredIndex` still be incremented even in the case of an error, as done around line 1589 and 1647? Do we need a similar change around line 2405? I sort of wonder if the correct change is to make `UpdateStructuredListElement()` resilient to being pa

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

2020-08-04 Thread Aleksandr Platonov via Phabricator via cfe-commits
ArcsinX created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. ArcsinX requested review of this revision. This patch prevents `InitListChecker::UpdateStructuredListElement()` call with `expr == nullptr` which could cause a crash. Repository: rG LLVM Gith