[PATCH] D75431: [analyzer][NFC] Merge checkNewAllocator's paramaters into CXXAllocatorCall

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 1 16:53:01 PST 2020


Szelethus created this revision.
Szelethus added reviewers: NoQ, baloghadamsoftware, balazske, martong, dcoughlin, xazax.hun, rnkovacs.
Szelethus added a project: clang.
Herald added subscribers: cfe-commits, steakhal, Charusso, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, whisperity.

Party based on this thread: http://lists.llvm.org/pipermail/cfe-dev/2020-February/064754.html.

This patch merges two of `CXXAllocatorCall`'s parameters, so that we are able to supply a `CallEvent` object to `check::NewAllocatorCall` (see the description of D75430 <https://reviews.llvm.org/D75430> to see why this would be great).

One of the things mentioned by @NoQ was the following:

> I think at this point we might actually do a good job sorting out this `check::NewAllocator` issue because we have a "separate" "Environment" to hold the other `SVal`, which is "objects under construction"! - so we should probably simply teach `CXXAllocatorCall` to extract the value from the objects-under-construction trait of the program state and we're good.

I had `MallocChecker` in my crosshair for now, so I admittedly threw together something as a proof of concept. Now that I know that this effort is worth pursuing though, I'll happily look for a solution better then demonstrated in this patch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75431

Files:
  clang/include/clang/StaticAnalyzer/Core/Checker.h
  clang/include/clang/StaticAnalyzer/Core/CheckerManager.h
  clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
  clang/lib/StaticAnalyzer/Checkers/AnalysisOrderChecker.cpp
  clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
  clang/lib/StaticAnalyzer/Core/CheckerManager.cpp
  clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
  clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75431.247532.patch
Type: text/x-patch
Size: 14189 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200302/c8207f7e/attachment-0001.bin>


More information about the cfe-commits mailing list