[PATCH] D121158: [clang][dataflow] Fix nullptr dereferencing error.

Yitzhak Mandelbaum via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 7 13:45:35 PST 2022


ymandel created this revision.
ymandel added a reviewer: sgatev.
Herald added subscribers: tschuett, steakhal.
Herald added a project: All.
ymandel requested review of this revision.
Herald added a project: clang.

When pre-initializing fields in the environment, the code assumed that all
fields of a struct would be initialized. However, given limits on value
construction, that assumption is incorrect. This patch changes the code to drop
that assumption and thereby avoid dereferencing a nullptr.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121158

Files:
  clang/include/clang/Analysis/FlowSensitive/Value.h
  clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
  clang/unittests/Analysis/FlowSensitive/TransferTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121158.413620.patch
Type: text/x-patch
Size: 11044 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220307/9309f973/attachment-0001.bin>


More information about the cfe-commits mailing list