[Sema] Validate calls to GetExprRange.
authorMark de Wever <koraq@xs4all.nl>
Sun, 16 Aug 2020 16:32:38 +0000 (18:32 +0200)
committerMark de Wever <koraq@xs4all.nl>
Sun, 16 Aug 2020 16:32:38 +0000 (18:32 +0200)
commit827ba67e383313b05e9b10c8215e501530d6c9e3
treec6791b7450a49c3585fd705a54e0dd1acddf5459
parentf25d47b7ed3e2e9ddb121471c5d4af76642cd48c
[Sema] Validate calls to GetExprRange.

When a conditional expression has a throw expression it called
GetExprRange with a void expression, which caused an assertion failure.

This approach was suggested by Richard Smith.

Fixes PR46484: Clang crash in clang/lib/Sema/SemaChecking.cpp:10028

Differential Revision: https://reviews.llvm.org/D85601
clang/lib/Sema/SemaChecking.cpp
clang/test/SemaCXX/conditional-expr.cpp