[analyzer] Fix StackFrameContext define in stack addr escape checker · llvm/llvm-project@029e7e9 (original) (raw)

File tree

1 file changed

lines changed

1 file changed

lines changed

Original file line number Diff line number Diff line change
@@ -249,14 +249,14 @@ void StackAddrEscapeChecker::checkPreCall(const CallEvent &Call,
249 249 /// that would leak.
250 250 class FindStackRegionsSymbolVisitor final : public SymbolVisitor {
251 251 CheckerContext &Ctxt;
252 -const StackFrameContext *StackFrameContext;
252 +const StackFrameContext *PoppedStackFrame;
253 253 SmallVectorImpl<const MemRegion *> &EscapingStackRegions;
254 254
255 255 public:
256 256 explicit FindStackRegionsSymbolVisitor(
257 257 CheckerContext &Ctxt,
258 258 SmallVectorImpl<const MemRegion *> &StorageForStackRegions)
259 - : Ctxt(Ctxt), StackFrameContext(Ctxt.getStackFrame()),
259 + : Ctxt(Ctxt), PoppedStackFrame(Ctxt.getStackFrame()),
260 260 EscapingStackRegions(StorageForStackRegions) {}
261 261
262 262 bool VisitSymbol(SymbolRef sym) override { return true; }
@@ -274,7 +274,7 @@ class FindStackRegionsSymbolVisitor final : public SymbolVisitor {
274 274 void SaveIfEscapes(const MemRegion *MR) {
275 275 const StackSpaceRegion *SSR =
276 276 MR->getMemorySpace()->getAs();
277 -if (SSR && SSR->getStackFrame() == StackFrameContext)
277 +if (SSR && SSR->getStackFrame() == PoppedStackFrame)
278 278 EscapingStackRegions.push_back(MR);
279 279 }
280 280