This revision was automatically updated to reflect the committed changes.
Closed by commit rG827ba67e3833: [Sema] Validate calls to GetExprRange.
(authored by Mordante).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85601/new/
https://reviews.llvm.o
rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.
Thanks!
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85601/new/
https://reviews.llvm.org/D85601
___
cfe-commits mailing list
cfe-commits@
Mordante updated this revision to Diff 285704.
Mordante marked an inline comment as done.
Mordante added a comment.
Addresses review comments.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85601/new/
https://reviews.llvm.org/D85601
Files:
clang/lib/Sema/SemaChecking.cpp
clang/test/
Mordante marked 3 inline comments as done.
Mordante added inline comments.
Comment at: clang/lib/Sema/SemaChecking.cpp:10317-10320
IntRange L =
GetExprRange(C, CO->getTrueExpr(), MaxWidth, InConstantContext);
IntRange R =
GetExprRange(C, CO->getFalseEx
rsmith added inline comments.
Comment at: clang/lib/Sema/SemaChecking.cpp:10164
const BuiltinType *BT = cast(T);
-assert(BT->isInteger());
+if (!BT->isInteger()) {
+ // This can happen in a conditional expression with a throw statement
Mordante
Mordante marked an inline comment as done.
Mordante added a comment.
I added `void g()` since that's valid code which also caused an assertion
failure. So the issue isn't in the error recovery but in determining the
required IntRange. It seems the code doesn't take
http://eel.is/c++draft/expr.c
rsmith added a comment.
Did this only crash during error recovery before, or also for your `void g()`
example? If we were only crashing in error recovery, that would suggest that
error recovery was producing a bad AST, and perhaps we should be fixing this
elsewhere.
Comment
Mordante created this revision.
Mordante added reviewers: rsmith, rjmccall.
Mordante added a project: clang.
Mordante requested review of this revision.
Fixes PR46484: Clang crash in clang/lib/Sema/SemaChecking.cpp:10028
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D85601
Fil