]> granicus.if.org Git - clang/commit
[analyzer] pr37688: Fix a crash upon evaluating a deleted destructor of a union.
authorArtem Dergachev <artem.dergachev@gmail.com>
Fri, 18 Jan 2019 23:05:07 +0000 (23:05 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Fri, 18 Jan 2019 23:05:07 +0000 (23:05 +0000)
commite6604f101fb09ae6fa05da0d4df230493e48579f
tree652a4df5a316025e2db665bf3075502bd0475b0a
parent4e2845d3c8072aa49fc4424a65d6f2b84dcda527
[analyzer] pr37688: Fix a crash upon evaluating a deleted destructor of a union.

Add a defensive check against an invalid destructor in the CFG.

Unions with fields with destructors have their own destructor implicitly
deleted. Due to a bug in the CFG we're still trying to evaluate them
at the end of the object's lifetime and crash because we are unable
to find the destructor's declaration.

rdar://problem/47362608

Differential Revision: https://reviews.llvm.org/D56899

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351610 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
test/Analysis/cfg.cpp
test/Analysis/unions.cpp