[clang] [NFC][analyzer] Spread use of 'Expr*' instead of 'Stmt*' (PR #188319)
Balázs Benics via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 1 08:09:05 PDT 2026
================
@@ -297,17 +297,19 @@ void ExprEngine::processCallExit(ExplodedNode *CEBNode) {
if (CE) {
if (const ReturnStmt *RS = dyn_cast_or_null<ReturnStmt>(LastSt)) {
const LocationContext *LCtx = CEBNode->getLocationContext();
+ // FIXME: This tries to look up the return statement in the environment,
+ // which is special cased to look up the subexpression RS->getRetValue()
+ // in environment. Instead of relying on this hack, pass
+ // RS->getRetValue() to getSVal() after checking it for nullness.
----------------
steakhal wrote:
Okay. Changing the getSVal to only accept Exprs shouldn't be hard and would clarify things.
I didn't understand what you mean by different overloads and that it queries the Environment.
In my mind, `getSVal` can't to anything but to query from the Environment. So I didn't get what' was your confusion about.
https://github.com/llvm/llvm-project/pull/188319
More information about the cfe-commits
mailing list