[clang] [Clang][analyzer] replace Stmt* with ConstCFGElementRef in SymbolConjured (PR #128251)
Fangyi Zhou via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 24 07:18:54 PDT 2025
================
@@ -2463,19 +2473,19 @@ void CStringChecker::evalStrsep(CheckerContext &C,
// character to NUL.
// As the replacement never overflows, do not invalidate its super region.
State = invalidateDestinationBufferNeverOverflows(
- C, State, SearchStrPtr.Expression, Result);
+ C, State, Call.getCFGElementRef(), Result);
// Overwrite the search string pointer. The new value is either an address
// further along in the same string, or NULL if there are no more tokens.
State =
State->bindLoc(*SearchStrLoc,
- SVB.conjureSymbolVal(getTag(), Call.getOriginExpr(),
+ SVB.conjureSymbolVal(getTag(), Call.getCFGElementRef(),
LCtx, CharPtrTy, C.blockCount()),
LCtx);
} else {
assert(SearchStrVal.isUnknown());
// Conjure a symbolic value. It's the best we can do.
- Result = SVB.conjureSymbolVal(nullptr, Call.getOriginExpr(), LCtx,
+ Result = SVB.conjureSymbolVal(nullptr, Call.getCFGElementRef(), LCtx,
C.blockCount());
}
----------------
fangyi-zhou wrote:
I've created a new pull request for this refactor https://github.com/llvm/llvm-project/pull/137182
Depending on which PR gets merged first I'll rebase one upon another.
https://github.com/llvm/llvm-project/pull/128251
More information about the cfe-commits
mailing list