This revision was automatically updated to reflect the committed changes.
Closed by commit rG706a4353e87b: [AST][RecoveryExpr] Error-dependent expression
should not be treat as a nullptr… (authored by hokein).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm
hokein added inline comments.
Comment at: clang/lib/AST/Expr.cpp:3747
case NPC_ValueDependentIsNull:
- if (isTypeDependent() || getType()->isIntegralType(Ctx))
+ if ((!containsErrors() && isTypeDependent()) ||
+ getType()->isIntegralType(Ctx))
hokein updated this revision to Diff 279715.
hokein marked an inline comment as done.
hokein added a comment.
address comment.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D84222/new/
https://reviews.llvm.org/D84222
Files:
clang/lib/AST/Expr.cpp
sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.
Comment at: clang/lib/AST/Expr.cpp:3747
case NPC_ValueDependentIsNull:
- if (isTypeDependent() || getType()->isIntegralType(Ctx))
+ if ((!containsErr
hokein added inline comments.
Comment at: clang/test/AST/ast-dump-recovery.c:51
+ // CHECK-NEXT: `-DeclRefExpr {{.*}} 'some_func'
+ ptr = some_func(); // should not crash
+}
For references, the crash stacktrace is like below, the cause is that we run
into
hokein updated this revision to Diff 279433.
hokein marked an inline comment as done.
hokein added a comment.
dump cast kind.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D84222/new/
https://reviews.llvm.org/D84222
Files:
clang/lib/AST/Expr.cpp
hokein created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
If an expression is contains-error and its type is unknown (dependent), we
don't treat it as a null pointer constant.
Fix a recovery-ast crash on C.
Repository:
rG LLVM Github Monorepo
https: