]> granicus.if.org Git - clang/commit
Fix crash when resolving branch conditions for temporary destructor condition blocks.
authorManuel Klimek <klimek@google.com>
Mon, 5 May 2014 09:58:03 +0000 (09:58 +0000)
committerManuel Klimek <klimek@google.com>
Mon, 5 May 2014 09:58:03 +0000 (09:58 +0000)
commitdb5c09f0d9f57df91c2e1fe8325dd9a757c848cb
treebfc3c3e28ae4c265308d674aec9a1c1c03b5508f
parenta337b33ab39c631768c60449b5b2857bedabf487
Fix crash when resolving branch conditions for temporary destructor condition blocks.

Document and simplify ResolveCondition.

1. Introduce a temporary special case for temporary desctructors when resolving
the branch condition - in an upcoming patch, alexmc will change temporary
destructor conditions to not run through this logic, in which case we can remove
this (marked as FIXME); this currently fixes a crash.

2. Simplify ResolveCondition; while documenting the function, I noticed that it
always returns the last statement - either that statement is the condition
itself (in which case the condition was returned anyway), or the rightmost
leaf is returned; for correctness, the rightmost leaf must be evaluated anyway
(which the CFG does in the last statement), thus we can just return the last
statement in that case, too. Added an assert to verify the invariant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207957 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/ExprEngine.cpp
test/Analysis/temporaries.cpp