[PATCH] D132918: [clang] Fix a crash in constant evaluation
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 7 01:22:17 PDT 2022
kadircet added a comment.
> This is helpful information but I am not sure this convinces me that EvaluateVarDecl is the correct place to check. Why not in EvaluateDecl or EvaluateStmt? Both locations we could also check.
I have done the check inside `EvaluateVarDecl` because the invalid evaluation happens when we try to analyze type of an invalid var decl.
I don't know if it would be safe to say we shouldn't evaluate any invalid decl. e.g. `EvaluateDecl` returns true for any non-vardecl today, without checking for anything at all. I don't know if changing the contract there, let alone at the statement level, would be correct. but doing it inside the vardecl evaluation is **at least** correct, but might be redundant.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D132918/new/
https://reviews.llvm.org/D132918
More information about the cfe-commits
mailing list